DTWAIN_SetLoggerCallback

Top  Previous  Next

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).  

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN_EnableMsgNotify

 

See Also

DTWAIN Acquisition Functions