BrianGEFF719
asked on
ReadFile API
I am using readfile api to read from a pipe however if there is no data in the pipe, it will just hang until data arrives, is there a way to just check the pipe for data instead of reading to prevent the hanging.
Please look at:
http://oldlook.experts-exchange.com/questions/20934771/CreateProcess-Pipe-Problem.html
I will award points for both questions if I can get an answer.
Please look at:
http://oldlook.experts-exchange.com/questions/20934771/CreateProcess-Pipe-Problem.html
I will award points for both questions if I can get an answer.
Use WaitForSingleObject but dont put INFINITE in that parameter, just wait a couple of milliseconds
ASKER
What does WaitForSingle object do?
ie
Public Type COMMTIMEOUTS
ReadIntervalTimeout As Long
ReadTotalTimeoutMultiplier As Long
ReadTotalTimeoutConstant As Long
WriteTotalTimeoutMultiplie r As Long
WriteTotalTimeoutConstant As Long
End Type
Public Declare Function SetCommTimeouts Lib "kernel32.dll" _
(ByVal hFile As Long, lpCommTimeouts As COMMTIMEOUTS ) _
As Long
Public Type COMMTIMEOUTS
ReadIntervalTimeout As Long
ReadTotalTimeoutMultiplier
ReadTotalTimeoutConstant As Long
WriteTotalTimeoutMultiplie
WriteTotalTimeoutConstant As Long
End Type
Public Declare Function SetCommTimeouts Lib "kernel32.dll" _
(ByVal hFile As Long, lpCommTimeouts As COMMTIMEOUTS ) _
As Long
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
its not a named pipe, its an anonymous pipe.
-Brian
-Brian
ASKER
sokolovsky!!! YOU ARE THE MAN! You saved my ass. Thank you so much