I have a structure like this:
[StructLayout(LayoutKind.Sequential, Pack=1, CharSet=CharSet.Ansi)]
public struct MyStruct
{
public long lVal;
public short sVal;
}
The structure is used like this:
MyStruct[] myArr = new MyStruct[5];
How can I serialize this array of structs into a byte-array?
For example, if I try to do this:
int rawsize = Marshal.SizeOf(myArr); // fails
then I get the following error message:
{"Type SingleTargetTupleSingle[] can not be marshaled as an unmanaged structure;
no meaningful size or offset can be computed." }
Any suggestions?
___0 Olav Langeland
_ \\ < URL: http://home.eunet.no/~olavla/
| | Mail at home: ol************@mail.com
(_) (_) at work: ol************@simrad.com