I have a problem with readfile function. I'm using it to read data from an anonymous pipe.I use it in a loop, that breaks when there's no more data(like icz tute). But i've got a strange problem because readfile after some iterations doesm't' return(maybe because the program at the other end of the pipe closed). Do you know a way to know if a pipe is still active or to resoolve the situation?
Thanks
Are you using overlapped I/O ?
If not then ReadFile will hang if there is no data, if you're using non-overlapped I/O then you should use PeekNamedPipe before you read, to make sure there is data there.
Umbongo
i had the exact same problem a while ago, but i forgot how i solved it :\ post your code and maybe we can spot the problem.