Click here to Skip to main content
15,898,373 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCalling another executable Pin
Gerry6-Mar-01 23:43
Gerry6-Mar-01 23:43 
GeneralRe: Calling another executable Pin
Prasanth Ekkoratha7-Mar-01 0:22
Prasanth Ekkoratha7-Mar-01 0:22 
GeneralRe: Calling another executable Pin
MickAB7-Mar-01 0:34
MickAB7-Mar-01 0:34 
GeneralRe: Calling another executable Pin
MickAB7-Mar-01 0:38
MickAB7-Mar-01 0:38 
GeneralRe: Calling another executable Pin
Gerry7-Mar-01 2:44
Gerry7-Mar-01 2:44 
GeneralRe: Calling another executable Pin
MickAB7-Mar-01 2:58
MickAB7-Mar-01 2:58 
GeneralRe: Calling another executable Pin
Gerry7-Mar-01 4:16
Gerry7-Mar-01 4:16 
GeneralRe: Calling another executable Pin
MickAB7-Mar-01 5:25
MickAB7-Mar-01 5:25 
OK, that's clearer.

If you call into another process from another process, you have two address spaces.
What this means in reality is this. You have a pointer to an area of memory (a C++ object for example). This pointer has a physical address, say 0x1000000 which is meaningful *only* in the address space it is created in. So if you have a separate process to which you pass this C++ object pointer to and try to de-reference it, then it will not point to the object you want.
This is why you need the shared-memory approach.
Of course, you have to come up with a way of calling a function in another process first using some form of IPC. (Into the realms of COM here).
In fact, that's what COM out-of-process servers are designed for.

NOTE: You can expose the C++ object as shared memory between two processes, but you still have to thread synch because two threads are (potentially) using the same memory concurrently.

If you want to create a separate thread in the same process then pass a C++ object by reference (pointer) then that's the simpler solution. You still have to synch access on the data (the C++ object's methods and attributes) though.

My advice, do the in-process (two threads in same address space) approach first, with thread synchronisation, then migrate the code to calling cross-process later.
GeneralRe: Calling another executable Pin
Gerry7-Mar-01 21:35
Gerry7-Mar-01 21:35 
GeneralGrid Pin
Vickie6-Mar-01 22:55
Vickie6-Mar-01 22:55 
GeneralRe: Grid Pin
l a u r e n6-Mar-01 23:09
l a u r e n6-Mar-01 23:09 
GeneralDoubt in ADO Pin
6-Mar-01 19:19
suss6-Mar-01 19:19 
GeneralRe: Doubt in ADO Pin
l a u r e n6-Mar-01 20:43
l a u r e n6-Mar-01 20:43 
GeneralError message...... Pin
Richard Cheng6-Mar-01 14:15
Richard Cheng6-Mar-01 14:15 
GeneralRe: Error message...... Pin
Christian Graus6-Mar-01 15:00
protectorChristian Graus6-Mar-01 15:00 
GeneralOnly One Instance to be opened... Pin
Manfred Ramosch6-Mar-01 12:12
Manfred Ramosch6-Mar-01 12:12 
GeneralRe: Only One Instance to be opened... Pin
l a u r e n6-Mar-01 12:18
l a u r e n6-Mar-01 12:18 
GeneralRe: Only One Instance to be opened... Pin
Manfred Ramosch6-Mar-01 12:44
Manfred Ramosch6-Mar-01 12:44 
GeneralRe: Only One Instance to be opened... Pin
l a u r e n6-Mar-01 20:38
l a u r e n6-Mar-01 20:38 
GeneralRe: Only One Instance to be opened - alternative Pin
.::RockNix::.6-Mar-01 21:15
.::RockNix::.6-Mar-01 21:15 
GeneralRe: Only One Instance to be opened - alternative Pin
l a u r e n6-Mar-01 22:51
l a u r e n6-Mar-01 22:51 
GeneralRe: Only One Instance to be opened - alternative Pin
.::RockNix::.7-Mar-01 2:24
.::RockNix::.7-Mar-01 2:24 
GeneralRe: Only One Instance to be opened - alternative Pin
James R. Twine7-Mar-01 3:46
James R. Twine7-Mar-01 3:46 
GeneralRe: Only One Instance to be opened - alternative Pin
.::RockNix::.7-Mar-01 4:22
.::RockNix::.7-Mar-01 4:22 
GeneralRe: Only One Instance to be opened - alternative Pin
James R. Twine7-Mar-01 5:39
James R. Twine7-Mar-01 5:39 

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.