I did what you said, and I'm not getting the error I was getting. the only problem is that the memory mapped file in the child process does not contain the same data as in the parent process.
please check the declarations and make sure I'm using the right parameters
parent process
Code:
A1=CreateFileMapping(
INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE,
0,
0x01400000,
"MAPPEDA1");
TEST=MapViewOfFile(A1, // handle to mapping object
FILE_MAP_ALL_ACCESS, // read/write permission
0, // max. object size
0, // size of hFile
0);
*((LPWORD)TEST)=50;
printf ("%d",*((LPWORD)TEST));
child process
Code:
A1=CreateFileMapping(
INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE,
0,
0x01400000,
"MAPPEDA1");
TEST=MapViewOfFile(A1, // handle to mapping object
FILE_MAP_ALL_ACCESS, // read/write permission
0, // max. object size
0, // size of hFile
0);
printf ("%d",*((LPWORD)TEST));
these both should print out 50 but I get 50 and 0
thanks for all your help so far