Hi, I’m trying to send some data using an InterprocessConnection. The data is in an object that’s of a class I defined, lets call it DataObject.
To send the message, can I just say:
DataObject* dObj = new DataObject();
MemoryBlock* mb = new MemoryBlock(dObj, sizeof(dObj));
then pass mb to sendMessage?
When it gets to the other side, how do I get the data out of it in the form of a DataObject? Should the following do the trick?
DataObject* dObj = (DataObject*)(mb.getData());
I know the doc mentions that the pointer will become invalid when the MemoryBlock is resized, it will also become invalid when we leave the messageRecieved() function, right?