News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Using a pipe

Started by tpekar, May 15, 2014, 10:46:33 PM

Previous topic - Next topic

tpekar

Does anyone have a simple example of using a pipe to communicate between a parent and child process?  Thanks!

jj2007

In assembler, yes:

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init
  Inkey "Current time is ", Launch$("cmd.exe /C time /T")
  Exit
end start


Seriously: Pipes are a can of worms. For example, to avoid hanging apps, you need to read data in separate threads etc...

To get an idea (and some really good hits), google for SECURITY_ATTRIBUTES HANDLE_FLAG_INHERIT CreatePipe SetHandleInformation CreateProcess WaitForInputIdle CreateThread

frankie

Could be a starting point...
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

frankie

#3
These are the standard native applications (from here).
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide