?
Mit CreateFileMapping, MapViewOfFile, usw. Ich habe es benutzt, um eine DLL zu schreiben, wo alle aufrufenden Prozesse den gleichen Speicherbereich verwenden.
// Create a named file mapping object.
hMapObject = CreateFileMapping(
(HANDLE) 0xFFFFFFFF, // use paging file
NULL, // no security attributes
PAGE_READWRITE, // read/write access
0, // size: high 32-bits
sizeof(TPLCComm), // size: low 32-bits
"NameOfMyObject"); // name of map object
if (hMapObject == NULL) return FALSE;
// The first process to attach initializes memory.
init = (GetLastError() != ERROR_ALREADY_EXISTS);
// Get a pointer to the file-mapped shared memory.
PMyObject = (TMyObject*) MapViewOfFile(
hMapObject, // object to map view of
FILE_MAP_WRITE, // read/write access
0, // high offset: map from
0, // low offset: beginning
0); // default: map entire file
if (PPLCComm == NULL) return FALSE;
In der Win32-Hilfe oder bei MS müßte es auch ein ausführlicheres Beispiel geben.
Rob'