Reads data from a communications device.
BOOLEAN ReadComm( COMMHANDLE hComm, // handle to device LPVOID lpBuffer, // data buffer DWORD nNumberOfBytesToRead, // number of bytes to read LPDWORD lpNumberOfBytesRead, // number of bytes read LPVOID lpOverlapped // unused );
hComm
lpBuffer
nNumberOfBytesToRead
lpNumberOfBytesRead
lpOverlapped
0
(zero)
This function returns when the number of bytes requested has been read, or an error occurs.
The behavior of ReadComm is governed by the current communication time-outs as set and retrieved using SetCommTimeouts and GetCommTimeouts. Unpredictable results can occur if you fail to set the time-out values. For more information about communication time-outs, see the COMMTIMEOUTS structure.
If ReadComm succeeds but NumberOfBytesRead is 0, determine if the EOF character has been received by calling ClearCommError, then examing the fEof field in COMSTAT.
E_BUSY
E_DISCONNECTED
E_IO
E_PARAM
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.1 | intime/rt/include/comm.h | comm.h | comm.lib |