Alex Farber
2010-09-06 11:16:33
@Patrick ,Updated the Code as per the Suggestions . Still Facing the same Issue.
Subhen
2010-09-06 12:08:46
@Alex Farber, The Function Returns True and Unable to get Last Error as the System keeps on waiting in Transact Named Pipe function
Subhen
2010-09-06 12:10:17
I was under the impression that the reverse was true: If an object is created without FILE_FLAG_OVERLAPPED then passing an overlapped structure results in undefined behaviour. However, in the reverse case - an FILE_FLAG_OVERLAPPED handle can be used for both synchronous and asynchronous operation.
Chris Becke
2010-09-06 12:22:25
If you create file without FILE_FLAG_OVERLAPPED flag, all I/O operations are synchronous and LPOVERLAPPED parameter should be NULL (if it is not NULL, it is possibly ignored). If file is created with FILE_FLAG_OVERLAPPED flag, all I/O operations are asynchronous and LPOVERLAPPED parameter must point to OVERLAPPED structure. This behavior is defined when file is created, and cannot be changed later.
Alex Farber
2010-09-06 12:29:11
+1
A:
For starters
m_OverLaped.hEvent=hPipe;
Is wrong, hEvent needs to be set to the event you've created, not the pipe. Before you do the read you need to call:
WaitForSingleObject( oOverlap.hEvent,
and then:
GetOverlappedResult()
Have you got the pipe working in non-overlapped mode?
Patrick
2010-09-06 11:16:49