I declared a struct with fixed size buffers to send it to an unmanaged function
[StructLayout (LayoutKind.Sequential)]
unsafe struct RCSTKAS
{
public fixed Byte xValue1 [12];
public fixed Byte xValue2 [30];
...
}
Before calling the external function that takes the struct as one of its
parameters I have to load some of the members. How can I copy for instance
the data of a String or a Byte[] to xValue1? I found no other solution than
writing an unsafe routine that defines 2 pointers and does the copying. Is
there a more elegant way to do this?
BTW: The other direction, copying data from the buffer to a String is no
problem thow as string offers a constructor taking a SByte*.
---
Burkhard