Pelles C forum
C language => Windows questions => Topic started by: tpekar on May 21, 2013, 09:28:57 PM
-
I am trying to use the _pipe() function to communicate back to the parent from the child process. My question is how does the parent communicate the pipe handle to the child process? If someone has a simple example showing how to communicate back and forth between the parent and the child that would be great! Thanks in advance.
-
The simplest way is to use memory communication through file mapping as in this sample (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366551(v=vs.85).aspx)
The same way is used by OutputDebugString as in my DebugReadser (http://forum.pellesc.de/index.php?topic=5351.0).
An example for pipes is here (http://msdn.microsoft.com/en-us/library/windows/desktop/aa373586(v=vs.85).aspx)
-
Here is simplified named pipe example to test.
Easier to google when some API names are seen.
Those who know about named pipes, please correct errors in example.