G
Guest
Hello there,
I wonder can anyone help point me in correct direction.
Basically I have a Managed structure and I want to Serialize to to a byte
array,
Then I want to read this byte array in my <u>UnManaged</u> c++ app and get
the contents.
The reason I nead to serialize the structure is that the Struct is being
sent via a message queue.
My C++ app should then read the message from the queue and be able to read
the contents.
Here is my structure (which i can change)
[StructLayout(LayoutKind.Sequential)]
[Serializable]
public class TraceMonitorMessage
{
public char[] szName = new char[64];
public string strMessage = null;
}
When slightly worried about writing a byte array in C# because it's gonna be
a managed array so i assume it writes a size when it gets binary serialized.
So my C++ app may have to step over this possibly?
I don't know the size of the strMessage in advance.
When i read my message from the Queue in the Unmanaged C++ app I can get the
szName and i know the the rest of the message body i've read is the
strMessage.
Can anyone give me an idea on where to look or how to proceed.
thanks in advance
Brian Keating
I wonder can anyone help point me in correct direction.
Basically I have a Managed structure and I want to Serialize to to a byte
array,
Then I want to read this byte array in my <u>UnManaged</u> c++ app and get
the contents.
The reason I nead to serialize the structure is that the Struct is being
sent via a message queue.
My C++ app should then read the message from the queue and be able to read
the contents.
Here is my structure (which i can change)
[StructLayout(LayoutKind.Sequential)]
[Serializable]
public class TraceMonitorMessage
{
public char[] szName = new char[64];
public string strMessage = null;
}
When slightly worried about writing a byte array in C# because it's gonna be
a managed array so i assume it writes a size when it gets binary serialized.
So my C++ app may have to step over this possibly?
I don't know the size of the strMessage in advance.
When i read my message from the Queue in the Unmanaged C++ app I can get the
szName and i know the the rest of the message body i've read is the
strMessage.
Can anyone give me an idea on where to look or how to proceed.
thanks in advance
Brian Keating