DTWAIN_GetCapContainer

Top  Previous  Next

The DTWAIN_GetCapContainer function gets the container type for a specific capability and capability operation.

 

LONG DTWAIN_GetCapContainer (

DTWAIN_SOURCE

Source,

LONG

Capability,

LONG

ContainerOp );

 

Parameters

Source

An open TWAIN Source.

 

Capability

The capability that is to be used.

 

ContainerOp

Indicates which type of container operation to check

 

Return Values

The return value is the TWAIN container type to use for the capability. A zero is returned if there is an error, or the Source does not support the capability or operation.

 

Comments

The DTWAIN_GetCapContainer function gets a Source's capability container to use.  The Source is the Source to check.  The Capability is the capability to test.  The ContainerOp is one of the following values:

 

Operation

Definition

DTWAIN_CAPGET                        

Get capability value

DTWAIN_CAPGETCURRENT        

Get current value

DTWAIN_CAPGETDEFAULT

Get default value

DTWAIN_CAPSETCURRENT

Set current value

DTWAIN_CAPSETAVAILABLE        

Set available values

                                         

On return of DTWAIN_GetCapContainer, one of the following values can be returned:

 

Container

TWAIN Equivalent

DTWAIN_CONTONEVALUE

TW_ONEVALUE type

DTWAIN_CONTARRAY                

TW_ARRAY  type

DTWAIN_CONTRANGE                

TW_RANGE  type

DTWAIN_CONTENUMERATION        

TW_ENUMERATION  type

0                                        

Error

 

DTWAIN_GetCapContainer gives information concerning a TWAIN container type.  Your application can use this information to set up the DTWAIN_ARRAY to use when calling DTWAIN_SetCapValue For example, if DTWAIN_GetCapContainer returns a DTWAIN_CONTARRAY or DTWAIN_CONTENUMERATION, your DTWAIN_ARRAY should be initialized with a series of values instead of a single value.  If the return type is DTWAIN_RANGE, you should set up a DTWAIN_RANGE type and use that as the DTWAIN_ARRAY to send to DTWAIN_SetCapValue.  If the return type is DTWAIN_ONEVALUE, the DTWAIN_ARRAY should contain only one value (if there is more than one value, DTWAIN_SetCapValue will ignore the remaining entries)

 

The DTWAIN application never needs to explicitly handle the TWAIN containers (such as TW_ARRAY, TW_RANGE, etc.), since the DTWAIN_ARRAY and DTWAIN handles these details.

.

TWAIN State Transitions

The Source must be in State 4 or higher (depending on the capability).

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

DTWAIN Source Selection Function

 

 

See Also

Setting / Getting Twain Capabilities