
PCI-1680U/1682U User Manual 46
4.3.10 GetOverlappedResult
When user's operation cannot be finished immediately in asynchronous mode, this
function should be called to wait operation to be completed.
Syntax
BOOL GetOverlappedResult(
HANDLE hDevice,
LPOVERLAPPED lpOverlapped,
LPDWORD lpNumberOfFramesTransferred,
BOOL bWait
);
Parameters
Return Value
Successful: return non-zero values. Unsuccessful: return zero value. Please call Get-
LastError function.
Example
#include <windows.h>
#include <stdio.h>
void main( )
{
HANDLE hDevice;
OVERLAPPED ov;
BOOL bSuccess;
DWORD dwEvtMask;
DWORD dwLength;
hDevice = CreateFile( "\\\\.\\CAN1",
GENERIC_READ | GENERIC_WRITE,
0, // exclusive access
NULL, // default security attributes
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL
);
Name Direction Description
hDevice Input Handle of the device which was opened.
lpOverlapped Input
Events need to be waited are included. Refer to MSDN
for more information.
lpNumberOf-
FramesTransferred
Output
ReadFile and WriteFile are real numbers of data written
and read; WaitCommEvent is not defined.
bWait Input
TRUE, will not return until read/write operation is fin-
ished. FALSE, return immediately no matter the opera-
tion is finished or not. Call GetLastError to return
ERROR_IO_INCOMPLETE. Refer to MSDN for
detailed information.
Comentarios a estos manuales