I suppose it's for interop, isn't it?
Well, if it isn't what about
:
struct MyStruct
{
public byte dataid;
public uint datasize;
public byte[] data;
}
if it is, what about
:
[StructLayout(Layout.Sequential)]
struct MyStruct
{
public byte dataid;
public uint datasize;
[ MarshalAs( UnmanagedType.ByValArray, SizeConst=100)]
public byte[] data;
}
"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:6C**********************************@microsof t.com...
Hi
I would like to create a struct like this on c# but I don't know how....
here it goes
byte: dataid
dword: datasize
byte[]: data
this means that I want to store the byte[0] an id, byte[1-4] the lenght,
and
the rest would be for the data.......
Please how can I do it?