-
12.3.4.
Reading Data From The Comm Port
Function Description:
Set the scanner to the working mode, and reset the communication control.
Function call:
BOOL ReadFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
Parameters(Input):
hFile:
HANDLE
: Handle to the com port to read from.
nNumberOfBytesToRead: DWORD
:
The
exact number of bytes you wish to
read from the data stream. The function will pause until this number or a timeout is reached.
lpOverlapped:
LPOVERLAPPED
: Not Supported, set to Null.
Parameters(Output):
lpBuffer:
LPCVOID
: Pointer to buffer containing data to write.
lpNumberOfBytesRead:
LPDWORD
:
pointer to a DWORD that will contain the
number of bytes read. A value of 0 will indicate there was no data in the stream and timeout
occured.
12.3.5.
Get error code
Function Description:
Read or Write functions will return Boolean false if there is a failure. The GetLastError() function will
then return the reason for the failure.
Function call:
DWORD GetLastError();
Return code:
Returns the error code most recently set. This must be called immediately after the failing function
to be relevant. See line 224 of the sample program.
Содержание MR650
Страница 1: ...MR650 Programming Manual V 1 12 1 16 2008 ...
Страница 7: ... 7 13 FUNCTION KEY SETTING ON REGISTRY 65 14 UPDATE NOTES 66 ...
Страница 16: ... it is for internal use send messages ...
Страница 33: ... Be aware to release handles when program ends ...