I'm working in the win32 api in C++. I have a parent process, and I'm using it to run a new program through a call to ShellExecute.
I'd like for the child process to be able to talk to the parent process (Communication only needs to go one way). I think an anonymous pipe would be suitable for this, and I've found how to create the pipe using the CreatePipe function, but I'm unsure of how to give the pipe to the child process using the ShellExecute command.
Could anyone point out a decent/relevant tutorial on this? Or, if another form of IPC works better than pipes, please point me in that direction.
In case its relevant, this is what my shell execute command looks like:
ShellExecute(NULL, "open", "Argo\\argo.exe", NULL, NULL, 1);
All things being equal, Windows "named pipes" might be an ideal way to go:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365590%28v=vs.85%29.aspx
Using a named pipe completely eliminates the need to pass ANYTHING between parent and child: the parent opens for reading, the child opens for writing whenever it needs to, everything's synchronized without any extra work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With