DTWAIN_SetLoggerCallback
|
The DTWAIN_SetLoggerCallback allows an application to use a callback function that will receive all of the logging strings generated by DTWAIN's DTWAIN_SetTwainLog function.
DTWAIN_BOOL DTWAIN_SetLoggerCallback ( DTWAIN_LOGGER_PROC lProc );
Parameters lpProc A pointer to a function that will be called whenever a DTWAIN log message is generated, or NULL to turn off the callback mechanism.
Return Values TRUE if successful, FALSE otherwise.
Comments DTWAIN_SetLoggerCallback allows an application to use a callback function for log messages generated by the DTWAIN library. Logging is initiated when the DTWAIN_SetTwainLog function is invoked.
Whenever the log message is generated, the user-defined callback function can process the logged message in any way the application sees fit. For example, a logging procedure could send the logged messages to the console, sent over a socket, etc.
The DTWAIN_CALLBACK_PROC is a function pointer with the following prototype:
void CALLBACK DTWAINLoggerProc(LPCTSTR logMsg);
where logMsg is the message that was logged. The CALLBACK is a constant defined by Windows.h to signify that this function will be a callback function (the CALLBACK constant is only important for C or C++ programs). Note that logMsg is a pointer to either an ANSI string or wide-character string, depending on whether the DTWAIN DLL that is in use is ANSI (dtwain32.dll, dtwain64.dll), or Unicode (dtwain32u.dll, dtwain64u.dll). If your application wants to use specific character type callbacks, use DTWAIN_SetLoggerCallbackA or DTWAIN_SetLoggerCallbackW. TWAIN State Transitions None.
Prerequisite Function Call(s)
See Also |