1

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.

sbunny
  • 433
  • 6
  • 25

1 Answers1

1

Take a look at Creating a Child Process with redirected input and output.

Alessandro
  • 25
  • 5