LTWAINTEMPLATECALLBACK

Summary

Called for each capability being loaded from the template file or saved from the TWAIN source. The address of this callback is passed as an argument L_TwainLoadTemplateFile and L_TwainSaveTemplateFile.

Syntax

#include "lttwn.h"

L_INT pEXT_CALLBACK YourFunction (hSession, pCapability, nStatus, pUserData)

Parameters

HTWAINSESSION hSession

Handle to an existing TWAIN session.

pTW_CAPABILITY * pCapability

Pointer to a TW_CAPABILITY structure that contains the capability.  For information on this structure, refer to the TWAIN specification.

L_INT nStatus

When used with L_TwainLoadTemplateFile, nStatus refers to whether pCapability was set successfully.  When used with L_TwainSaveTemplateFile, nStatus refers to whether the pCapability was successfully added to the template file.

L_VOID * pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_TwainLoadTemplateFile or L_TwainSaveTemplateFile.)

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

Value Meaning
TWAIN_SUCCESS The function was successful.
TWAIN_SUCCESS_ABORT The callback wants to abort the operation.
< 1 An error occurred. Refer to Return Codes.

Comments

Use this callback to alert the user of any failures in setting a capability when loaded from a template file.  You can also use this callback to provide a listing of all capabilities and their possible values found in a template file or being saved to a template file.

Required DLLs and Libraries

See Also

Functions

Topics

Example

For an example, refer to L_TwainSaveTemplateFile.

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.