Click here to Skip to main content
15,906,569 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: memory could not be "read" Pin
led mike3-Apr-08 10:42
led mike3-Apr-08 10:42 
GeneralRe: memory could not be "read" Pin
Mark Salsbery3-Apr-08 10:45
Mark Salsbery3-Apr-08 10:45 
GeneralDll and global variables. Pin
Dimitris Vikeloudas3-Apr-08 5:55
Dimitris Vikeloudas3-Apr-08 5:55 
GeneralRe: Dll and global variables. Pin
Joseph Marzbani3-Apr-08 6:03
Joseph Marzbani3-Apr-08 6:03 
GeneralRe: Dll and global variables. Pin
Dimitris Vikeloudas3-Apr-08 6:20
Dimitris Vikeloudas3-Apr-08 6:20 
AnswerRe: Dll and global variables. Pin
cyrfer9-Apr-08 15:49
cyrfer9-Apr-08 15:49 
GeneralRe: Dll and global variables. [modified] Pin
Dimitris Vikeloudas10-Apr-08 3:27
Dimitris Vikeloudas10-Apr-08 3:27 
GeneralRe: Dll and global variables. Pin
malaugh3-Apr-08 10:33
malaugh3-Apr-08 10:33 
There may be a easier way to do this, but one way is to create global shared memory is to use CreateFileMapping on one DLL, and OpenFileMapping in the other.

Pseudo-code is something like:

DLL #1
------
int *pMemory;

hMem = CreateFileMapping(....."MySharedMemory");
pMemory = (int *)MapViewOfFile(hMem);
pMemory = 3;

DLL #2
-------
int *pMemory;
int Value;

hMem = OpenFileMapping(....."MySharedMemory");
pMemory = (int *)MapViewOfFile(hMem);
Value = *pMemory;

Note sure if this is 100% correct, its been a while since I used it. grep in codeproject for "Shared Memory with IPC with threads" to get more details.
GeneralRe: Dll and global variables. Pin
Dimitris Vikeloudas3-Apr-08 22:39
Dimitris Vikeloudas3-Apr-08 22:39 
GeneralCComPtr Pin
George_George3-Apr-08 4:47
George_George3-Apr-08 4:47 
GeneralRe: CComPtr Pin
led mike3-Apr-08 5:14
led mike3-Apr-08 5:14 
GeneralRe: CComPtr Pin
George_George3-Apr-08 21:16
George_George3-Apr-08 21:16 
GeneralA2WBSTR Pin
George_George3-Apr-08 4:40
George_George3-Apr-08 4:40 
GeneralRe: A2WBSTR Pin
James R. Twine3-Apr-08 4:54
James R. Twine3-Apr-08 4:54 
GeneralRe: A2WBSTR Pin
George_George3-Apr-08 21:29
George_George3-Apr-08 21:29 
GeneralRe: A2WBSTR Pin
CPallini3-Apr-08 5:47
mveCPallini3-Apr-08 5:47 
GeneralRe: A2WBSTR Pin
George_George3-Apr-08 21:27
George_George3-Apr-08 21:27 
GeneralRe: A2WBSTR Pin
CPallini3-Apr-08 22:38
mveCPallini3-Apr-08 22:38 
GeneralRe: A2WBSTR Pin
George_George3-Apr-08 23:04
George_George3-Apr-08 23:04 
GeneralRe: A2WBSTR Pin
CPallini3-Apr-08 23:15
mveCPallini3-Apr-08 23:15 
GeneralRe: A2WBSTR Pin
George_George3-Apr-08 23:18
George_George3-Apr-08 23:18 
GeneralRe: A2WBSTR Pin
CPallini3-Apr-08 23:29
mveCPallini3-Apr-08 23:29 
GeneralRe: A2WBSTR Pin
George_George3-Apr-08 23:32
George_George3-Apr-08 23:32 
Generalesoteric use of the "new" keyword Pin
Dave Calkins3-Apr-08 4:12
Dave Calkins3-Apr-08 4:12 
GeneralRe: esoteric use of the "new" keyword Pin
James R. Twine3-Apr-08 4:51
James R. Twine3-Apr-08 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.