Posted by Rajeev Menon (206.103.12.125) on July 17, 2000 at 11:19:21:
Friend,
For the last some days, i'm facing a problem while woking with Win-32 APIs. I will explain the
situation:
I have a program which in turn gives a "CreatePocess" to another external executable. I
now want to redirect the I/O of the external program to an anonymous pipe (not named pipe). This
pipe I will be creating in the parent process and giving it in the redirect handle of
CreateProcess. Now I am reading the output handle and writing the input handle from the parent
process. For writing into the handle i'm using "WriteFile" and "ReadFile" to read the output
handle. The WriteFile is writing the buffer into the pipe and coming out after that. But the
ReadFile is waiting infinitely till the whole external program gets over. Then atlast I'm getting
the whole output together.
What I want is that the "ReadFile" should come out after a single read and should not
wait in the read. What do I do for that ? I cannot change the anonymous pipe to a named pipe.
Thankx,
Rajeev... INDIA.