How to Work with the Containers - MFC

Due to differences in Visual Basic and MFC, LEADTOOLS provides interfaces specifically for working with containers in MFC. These are discussed here.

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

TW_ARRAY

TW_ENUMERATION

TW_ONEVALUE

TW_RANGE

For more information on these container types, refer to the TWAIN 1.9 Specification, available at www.twain.org.

The LEADTOOLS TWAIN toolkit provides an interface for each container type and the TW_CAPABILITY structure.

The ICapability interface represents the TW_CAPABILITY structure. This interface has two properties that are used in setting and getting the capabilities:

image\sqrblit.gif The Capability property contains the capability constant that indicates the specific capability.

image\sqrblit.gif ConType property defines the type of the container to use when setting the capability or the container used to get the capability values. The possible container types are defined in the ICapabilityOneValue, ICapabilityEnumeration, ICapabilityArray, and ICapabilityRange interfaces. They can be got by calling the QueryInterface method from the ICapability interface.

The ICapabilityOneValue interface represents a container of type TW_ONEVALUE. This interface has the following properties:

image\sqrblit.gif The OneValItemType property contains the type of data contained in the ICapabilityOneValue interface).

image\sqrblit.gif The OneValCapValue property contains the actual value of the ICapabilityOneValue interface.

The ICapabilityEnumeration interface represents a container of type TW_ENUMERATION. This interface has the following properties:

image\sqrblit.gif The EnumItemType property contains the type of data contained in the ICapabilityEnumeration interface.

image\sqrblit.gif The EnumCapValue property contains the actual value(s) of the ICapabilityEnumeration interface.

image\sqrblit.gif The EnumNumOfItems property contains the number of values in the ICapabilityEnumeration interface.

image\sqrblit.gif The EnumCurrentIndex property contains the index of the current value of the ICapabilityEnumeration interface.

image\sqrblit.gif The EnumDefaultIndex property contains the index of the default value of the ICapabilityEnumeration interface.

The ICapabilityRange interface represents a container of type TW_RANGE. This interface has the following properties:

image\sqrblit.gif The RangeItemType property contains the type of data contained in the ICapabilityRange interface.

image\sqrblit.gif The RangeCurrentValue property contains the current value of the ICapabilityRange interface.

image\sqrblit.gif The RangeDefaultValue property contains the default value of the ICapabilityRange interface.

image\sqrblit.gif The RangeMinimumValue property contains the minimum value in the range of the ICapabilityRange interface.

image\sqrblit.gif The RangeMaximumValue property contains the maximum value in the range of the ICapabilityRange interface.

image\sqrblit.gif The RangeStepSize property contains the step size in the range of the ICapabilityRange interface.

The ICapabilityArray interface represents a container of type TW_ARRAY. This interface has the following properties:

image\sqrblit.gif The ArrayItemType property contains the type of data contained in the ICapabilityArray interface.

image\sqrblit.gif The ArrayCapValue property contains the actual value(s) of the ICapabilityArray interface.

image\sqrblit.gif The ArrayNumOfItems property contains the number of items in the ICapabilityArray interface.

The ItwFrame interface represents a structure of type TW_FRAME. It contains information about the area of the image to acquire. This interface has the following properties:

image\sqrblit.gif The RightMargin property contains the right margin value.

image\sqrblit.gif The LeftMargin property contains the left margin value.

image\sqrblit.gif The TopMargin property contains the top margin value.

image\sqrblit.gif The BottomMargin property contains the bottom margin value.