How to Work with the Containers

When getting or setting capability information, it may be necessary to create a container for the associated TW_CAPABILITY structure. The structure of these containers depends on the type of information in the container. LEADTOOLS supports the following types of containers:

For more information on these container types, refer to the TWAIN specification.

For each type of container, LEAD provides a specific function:

The value in a container can be changed once the user has a pointer to the container. To change the value of a container, the user can call LTwain::LockContainer, make the desired changes to the container value(s), and then call LTwain::UnlockContainer. Alternately, the user can accomplish the same thing be calling the C API GlobalLock and GlobalUnlock functions.

When the created container is no longer needed, free it by calling LTwain::FreeContainer.

LEAD provides a number of functions, based on the data type of the value, for getting container values. To get the data type of the value in a container, call LTwain::GetNumericContainerItemType. Once the type is known, the following functions can be used to get the container value(s) from the TW_CAPABILITY structure:

To get the available values for a specific TWAIN capability, call LTwain::QueryProperty. This function takes a pointer to a LTWAINPROPERTYQUERY structure, which will be updated with the available values for the capability.

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

LEADTOOLS TWAIN C++ Class Library Help