Child Process & Parent Process Data :: Win32 
Author Message
 Child Process & Parent Process Data :: Win32

Hi.

How do you pass data and/or pointer to data in a parent
process, both primary and/or child threads, to the primary
thread (default) of a child process?

Jeffrey Richter demonstrates the use of CreateProcess(),
but he does not discuss a way to pass in data.

Thanks,
Kuphryn



Sat, 26 Feb 2005 23:48:21 GMT  
 Child Process & Parent Process Data :: Win32

Quote:
> Hi.

> How do you pass data and/or pointer to data in a parent
> process, both primary and/or child threads, to the primary
> thread (default) of a child process?

> Jeffrey Richter demonstrates the use of CreateProcess(),
> but he does not discuss a way to pass in data.

If you wish to share data between the apps then take a look at memory mapped
files (CreateFileMapping) and for locking you'll probably want a mutex
(CreateMutex).

If you just wish to pass from parent to child then a simple file or command
line might do.

Or, you could use pipes, or if they have both have a message loop you could
fudge it with WM_COPYDATA.

--
russ.
http://www.gipsysoft.com/articles/winspector/ - FREE Spy++ replacement.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids



Sun, 27 Feb 2005 01:16:17 GMT  
 Child Process & Parent Process Data :: Win32
Nice!  Thanks.

Which methods of passing data across processes performs
best?

Kuphryn



Sun, 27 Feb 2005 15:45:10 GMT  
 Child Process & Parent Process Data :: Win32

Quote:
> Nice!  Thanks.

> Which methods of passing data across processes performs
> best?

TBH I've never had the need to profile them. I'm sure someone, somewhere
has. Why not post a new message asking exactly that.

--
russ.
http://www.gipsysoft.com/articles/winspector/ - FREE Spy++ replacement.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids



Sun, 27 Feb 2005 22:15:42 GMT  
 Child Process & Parent Process Data :: Win32

Quote:

> Nice!  Thanks.

> Which methods of passing data across processes performs
> best?

> Kuphryn

A memory mapped file (mapped to the page file) is instantaneous with
zero overhead: It is shared memory and the data does not have to be
copied between the processes.  

--
Scott McPhillips [VC++ MVP]



Mon, 28 Feb 2005 00:02:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Creating the child process and redirected to parent process

2. How to get child process to die when parent dies

3. Parent Process kill Hanging Child

4. HELP: child process catching death of parent

5. Parent/Child Process

6. passing information from child to parent process

7. Parent-child process control

8. detaching child process from parent

9. Processing a message the parent before the child window

10. Created Process dies when parent process closed

11. Parent-child process control

12. monitoring the process time of a child process

 

 
Powered by phpBB® Forum Software