Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMessage Pin
Rage4-Jun-03 0:59
professionalRage4-Jun-03 0:59 
GeneralRe: Message Pin
jhwurmbach4-Jun-03 1:14
jhwurmbach4-Jun-03 1:14 
GeneralRe: Message Pin
Anonymous4-Jun-03 2:01
Anonymous4-Jun-03 2:01 
GeneralRe: Message Pin
peterchen4-Jun-03 2:40
peterchen4-Jun-03 2:40 
GeneralRe: Message Pin
Rage4-Jun-03 3:23
professionalRage4-Jun-03 3:23 
GeneralRe: Message Pin
Magnus Westin4-Jun-03 3:38
Magnus Westin4-Jun-03 3:38 
GeneralRe: Message Pin
jhwurmbach4-Jun-03 4:05
jhwurmbach4-Jun-03 4:05 
GeneralRe: Message Pin
peterchen4-Jun-03 3:58
peterchen4-Jun-03 3:58 
Rage wrote:
Why is this working, then?

You could be lucky Wink | ;)
Or, if it's the same binary, you're just passing a pointer into the data segment. As EXE's are usually mapped to the same beginning address, it works most of the time.

CMemFile is not the right thing, it's just a file in "normal" memory, but not shared between processes.

Look up CreateFileMapping and MapViewOfFile in the Win32 documentation.

And I said "relatively easy" - it's just a way to share some memory between two applications. Instead of the pointer, both sides would need to agree on a common name for the mapping - it's recommended to include a GUID in the name of the mapping - and you would have to e.g. pass an offset to the actual string. if it's just about a string, use WM_COPYDATA.



"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS

sighist | Agile Programming | doxygen

GeneralRe: Message Pin
Peter Weyzen4-Jun-03 9:32
Peter Weyzen4-Jun-03 9:32 
GeneralDefining operator << Pin
Shah Shehpori4-Jun-03 0:45
sussShah Shehpori4-Jun-03 0:45 
GeneralRe: Defining operator << Pin
Magnus Westin4-Jun-03 2:48
Magnus Westin4-Jun-03 2:48 
GeneralRe: Defining operator << Pin
Mike Nordell4-Jun-03 2:49
Mike Nordell4-Jun-03 2:49 
GeneralModifying window style Pin
Zizilamoroso4-Jun-03 0:19
Zizilamoroso4-Jun-03 0:19 
GeneralRe: Modifying window style Pin
Hans Ruck4-Jun-03 0:39
Hans Ruck4-Jun-03 0:39 
GeneralRe: Modifying window style Pin
Zizilamoroso4-Jun-03 1:28
Zizilamoroso4-Jun-03 1:28 
Generalembedding window into dialog Pin
Jump_Around4-Jun-03 0:17
Jump_Around4-Jun-03 0:17 
GeneralControlling Access To Temporary File Pin
Poul Haahr Klemmensen3-Jun-03 23:36
Poul Haahr Klemmensen3-Jun-03 23:36 
GeneralRe: Controlling Access To Temporary File Pin
BhaskarBora4-Jun-03 1:18
BhaskarBora4-Jun-03 1:18 
GeneralRe: Controlling Access To Temporary File Pin
Neville Franks4-Jun-03 2:47
Neville Franks4-Jun-03 2:47 
GeneralRe: Controlling Access To Temporary File Pin
BhaskarBora4-Jun-03 21:07
BhaskarBora4-Jun-03 21:07 
GeneralRe: Controlling Access To Temporary File Pin
Neville Franks4-Jun-03 2:58
Neville Franks4-Jun-03 2:58 
GeneralPointer to structure problem... Pin
IrishSonic3-Jun-03 23:09
IrishSonic3-Jun-03 23:09 
GeneralRe: Pointer to structure problem... Pin
jhwurmbach3-Jun-03 23:30
jhwurmbach3-Jun-03 23:30 
GeneralRe: Pointer to structure problem... Pin
Dominik Reichl3-Jun-03 23:35
Dominik Reichl3-Jun-03 23:35 
GeneralRe: Pointer to structure problem... Pin
jhwurmbach3-Jun-03 23:41
jhwurmbach3-Jun-03 23:41 

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.