DTWAIN_SetCallback64

Top  Previous  Next

The DTWAIN_SetCallback64 allows an application to use a callback function for DTWAIN notifications.

 

DTWAIN_CALLBACK_PROC64 DTWAIN_SetCallback64 (

DTWAIN_CALLBACK_PROC64

lProc,

DTWAIN_LONG64

UserData );

 

Parameters

lpProc

    A pointer to a function that will be called whenever a DTWAIN notification is sent, or NULL (0) to turn off the callback mechanism.

 

UserData

    Optional 64-bit user-defined data that will be passed when Callback function is invoked.  If the UserData requires a 32-bit type, use DTWAIN_SetCallback.

 

Return Values

If a callback function was previously set, this function returns the last callback function.  Otherwise a NULL is returned.

 

Comments

DTWAIN_SetCallback64 operates the same way as DTWAIN_SetCallback.  The only difference is that the UserData is specified as a 64-bit type instead of a 32-bit type, and that the callback function, lProc, must have the following prototype:

 

LRESULT CALLBACK DTWAINCallbackProc(WPARAM wParam, LPARAM lParam, DTWAIN_LONG64 UserData);

 

If your application has set callback functions using both DTWAIN_SetCallback and DTWAIN_SetCallback64, the callback function associated with DTWAIN_SetCallback is always called prior to calling the callback function associated with DTWAIN_SetCallback64.  Therefore, if you have both callbacks invoked, the callback associated with DTWAIN_SetCallback64 must return the proper LRESULT value, else the program will invoke erratic behavior.

 

For Windows C/C++ programmers: A DTWAIN_LONG64 type is equivalent to a 64-bit integer type.  Most compilers also recognize __int64 or equivalent integer types as a 64-bit type, and therefore can be used as the UserData parameter.

 

See DTWAIN Notifications Using a Callback Function for more details.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN_EnableMsgNotify

 

See Also

DTWAIN Acquisition Functions