-
2. USI.DLL - Unitech Scanner Interface DLL
2.1. Register the application to the USI DLL
Function Description:
Register the application to the USI DLL, so that the DLL can communicate with the application. It will
also open and initial scanner port (COM2, for example) and set the scanner to the working mode.
The application should call USI_Unregister to unregister from the DLL after done with the scanner.
Function call:
BOOL
USI_Register
(
HWND
hwnd
,
UINT
msgID
);
Parameter: (input)
hwnd:
Handle of the window to which USI DLL will send messages to report all activities,
including error messages, scan data ready, etc.
msgID:
Specifies the message to be posted. DLL will post messages by calling:
PostMessage(hwnd, msgID, msg, param).
The window procedure will receive custom message about msgID and wParam
parameter can be one of the followings:
SM_ERROR_SYS
Indicates a system error, which is caused by a call to the system
function. Param contains the error code from GetLastEror().
SM_ERROR
Indicates an error. Param contains the cause of error, which can be
on of followings:
SERR_INVALID_HWND:
Invalid window handle.
SERR_INVALID_MSGID:
msgID cannot be 0.
SERR_OPEN_SCANNER:
Open or initial scanner port failed.
SERR_CHECKSUM:
Checksum error in received packet.
SERR_DATALOST:
New scan data is lost because data buffer is not
empty.
SERR_BUFFEROVERFLOW:
Data buffer overflow. The default size is 4K bytes.
SM_REPLY
Indicates received a reply. All the responses from the scanner
except the scan data will be notified by this message.
SM_DATAREADY
Indicates that scan data is successfully decoded and ready to
retrieve.
SM_ACK
Indicates received a ACK.
SM_NAK
Indicates received a NAK.
SM_NOREAD
Indicates received a No-Read packet.
Note: Scanner port settings are defined in registry as described below:
[HKEY_LOCAL_MACHINE\SOFTWARE\Unitech America Inc.\Scanner\Settings]
"COMPORT"="COM2:"
"BAUDRATE"="38400"
"STOPBITS"="1"
"PARITY"="None"
"CHECKPARITY"="1"
Содержание 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 ...