8.13
S
CAN
E
RR
T
O
T
EXT
()
Prototype:
SCAN_RESULT ScanErrToText(SCAN_RESULT Err, LPTSTR lpBuff, LPINT BufSize);
Purpose:
Converts error code to text.
Arguments:
[in] Err is the error generated by a ScanAPI function call that you wish to have translated to text.
[out] lpBuff is a buffer allocated by the client program to receive the text. Note the result is
returned in UNICODE on CE devices.
[in/out] BufSize points to an integer that must be set to the size of lpBuff before the
ScanErrToText() function is called – it will be filled in by the SDK with the size of the error text (in
bytes) upon return. This value can be converted to a character count by dividing BufSize by the
sizeof(TCHAR). Typically the byte count will equal the character count on Win32 Desktop
systems.
Notes:
To discover the size of the error text without actually retrieving it, you may use NULL as the
lpBuff argument – in this case BufSize will be filled in with the size of the error message and the
function will return successfully. If lpBuff is not NULL and the buffer is too small, no data transfer
will take place, the size of the buffer necessary will be written to BufSize, and the function will
return SR_BUFFER_TOO_SMALL.
Returns:
SR_SUCCESS
The operation completed successfully.
SR_INVALID_ERR
The error you are trying to translate is not known.
SR_BUFFER_TOO_SMALL
A larger buffer is required to accommodate the text.
SR_INTERNAL_FAILURE
An unexpected error occurred in the ScanAPI DLL.
April 8, 2010
Page 38
Document#: 6410-00147 K
Revision 2.28