DTWAIN_SetErrorCallback

Top  Previous  Next

The DTWAIN_SetErrorCallback allows an application to use a callback function that will receive the errors generated by DTWAIN functions.

 

DTWAIN_BOOL DTWAIN_SetErrorCallback (

DTWAIN_ERROR_PROC lpProc,


LONG userData );



Parameters

lpProc

    A pointer to a function that will be called whenever a DTWAIN error is generated, or NULL to turn off the callback mechanism.


userData

    A user-defined data value that will be sent along with the error value.

 

Return Values

TRUE if successful, FALSE otherwise.

 

Comments

DTWAIN_SetErrorCallback allows an application to use a callback function for error generated by the DTWAIN library.  The errors are ones usually generated when calling a DTWAIN function, where any errors can be retrieved by calling DTWAIN_GetLastError.

 

The DTWAIN_ERROR_PROC is a function pointer with the following prototype:

 

LONG CALLBACK DTWAINErrorrProc(LONG errorValue, LONG userData);

 

where errorValue is the error value, and userData is the original userData that was passed when DTWAIN_SetErrorCallback was called.


The callback function should return a value of 1.  Note that currently, DTWAIN ignores the return value, but this may change in future versions of DTWAIN.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN_EnableMsgNotify

 

See Also

DTWAIN Acquisition Functions