I am creating a child process, and reading its output. My code works fine when the child process creates output (cmd /c echo Hello World
), however ReadFile will
You redirect the output of the process to a pipe, start the process, wait till it exits, and then read the output.
The problem is that windows buffers just a limited amount of data. So you must read the pipe while the process is still running, otherwise the process will be blocked because it cannot write any more data to the pipe.