Hi,
I'm deveoping a Client/Server application.
I want to send information by using structures.
I want to have a standard header structure, and variable lenght
data.
for example,
---------------------------------------
public struct Header
{
public int sequenceNumber;
public int serviceRequest ;
----
----
}
public struct Info
{
Header head;
byte[] data;
}
-------------------------------
How do we marshal "Info" structure with variable byte[] data.
Currently I'm marshalling in the following way,
[MarshalAs( UnmanagedType.ByValArray, SizeConst= 1024)]
byte[] data;
but as the data should be of variable length, how can we marshal the byte[]
without specifying the size of the byte[]. I mean is there any way that we
can
find the size of the byte[] just before marshalling the sturcture "Info".
Kindly let me know,
Cheers,
Naveen.