Shared memory in VC++

Intel / P4
April 28, 2010 at 06:08:40
Specs: Windows XP, 512


I am trying to share memory between two VC++ projects.

I created a shared segment as

#pragma data_seg(".SHARED")
unsigned char buffer[5] = {0};
unsigned char offset[5] = {0};

#pragma data_seg()

#pragma comment(linker, "/section:.SHARED,RWS")

In one project i am writing data into the buffer and offset arrays and from another project i am trying to read from these arrays.

But it is not working..

Pl help..

See More: Shared memory in VC++

Report •

April 28, 2010 at 08:23:52
If these projects compile into separate executables, you'll need to use interprocess communication.

Report •

April 29, 2010 at 07:32:06
Yes..they are seperate executables..

Could you please give some examples how to do interprocess communication with two executables..?

Report •

April 29, 2010 at 09:35:31
Ah, but there are, like, 9 distinct ways for one program to talk to another. Read the page I linked, pick the best one for your situation, and there'll probably be an example of it somewhere. It's MSDN, after all. They try to make these things simple.

Report •

Related Solutions

Ask Question