Communicate with stdin / stdout of a child process asynchronously

I want to create a child process and read its stdout asynchronously. Turns out I have to create a named pipe to connect to stdout, since anonymous pipes do not support asynchronous reads.

I know about the functions CreateProcess , CreateNamedPipe , CreateFile and ReadFile , but is there any example code that connects them all? I am blinded by a sea of โ€‹โ€‹parameters.

+4
source share
2 answers

Basically you add your channel descriptor to the STARTUPINFO structure in CreateProcess.

I think I used this sample code before: http://msdn.microsoft.com/en-us/library/ms682499(v=vs.85).aspx

0
source

Source: https://habr.com/ru/post/1338763/


All Articles