Hi All.

I am using ProtoBuf-Net in my .NET application to serialize the
following : (in .proto format)

message ProtoScreenBuffer {
optional int32 MediaId = 1;
optional bytes Data = 2;
optional bool LastBuffer = 3;
optional int64 StartTime = 4;
optional int64 StopTime = 5;
optional int32 Flags = 6;
optional int32 BufferSubType = 7;
optional int32 BufferType = 8;
repeated int32 EncryptedDataStart = 9;
repeated int32 EncryptedDataLength = 10;

I serialize this into a byte array, using protobuf-net,
and pass it to the C++ app.
What goes out of the .NET and what comes into the C++ app is 100%

It then should be deserialized in the C++ app.

I try to do :

m_screenBuffer.ParseFromArray(serBuffer, dwInputDataLen);
(where m_screenBuffer is ProtoScreenBuffer object, serBuffer is the
raw byte array I got from the .NET app,  and dwInputDataLen is the
length of it.)

The problem is, I get a memory access violation when I try to
deserialize it :(
Unhandled exception at 0x02f166d8 in wmplayer.exe: 0xC0000005: Access
violation writing location 0x00000000.

Are any of the things I'm doing here wrong , for what I'm trying to do
(serialize in C# .NET and deserialize in C++?)

Thanks alot.


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to