How can I share the data between two managed processes using shared memory segments? I am using "object"
inside C++/CLI code to share the data with some other part of memory in the other process. I am using following code segment.
#define BUFFER_SIZE 32768
#pragma data_seg (".SHAREDMEMORY")
bool _Locked = false;
bool _Initialized = false;
unsigned char[10000] data = NULL;
#pragma data_seg()
#pragma comment(linker,"/SECTION:.SHAREDMEMORY,RWS")
but I need it to be:
#pragma data_seg (".SHAREDMEMORY")
bool _Locked = false;
bool _Initialized = false;
object^ _object = nullptr;
#pragma data_seg()
#pragma comment(linker,"/SECTION:.SHAREDMEMORY,RWS")
It is saying that "global or static variable may not have managed type System::Int32^"
and giving other errors like "missing ; before '^'"
.
I have to copy the .NET "Control"
object's data to this shared segment and I need it to transfer to another process.
object^
is a pointer, not the object itself. Even if you made anobject^
global, the object would still be on the private managed heap of just one process.