I have a main c++ program. This program at its startup launches another process executable using CreateProcess() function. Now I want to redirect the standard output (stdout) of this new process to the main c++ program. For this purpose I would like to use a pipe in windows. I am able to achieve this in linux using fork() and pipe (), but I am unable to get CreatePipe() working on windows. The pipe is created but I am unable to get any data.
Can someone please provide me some example or sample code for this purpose ? I have successfully redirected the stdout of CreateProcess to a file but the pipe does not work.
Thanks in advance.