DTWAIN_GetCapDataType

Top  Previous  Next

The DTWAIN_GetCapDataType returns the TWAIN data type to use when retrieving or setting a capability's values.

 

LONG DTWAIN_GetCapDataType (

DTWAIN_SOURCE

Source,

LONG

Capability );

 

Parameters

Source

A valid DTWAIN_SOURCE if Capability is a custom capability.  NULL otherwise.

 

Capability

The capability that is to be queried for the data type.

 

Return Values

The actual TWAIN data type that the capability uses to retrieve or set values.

 

Comments

 

The DTWAIN_GetCapDataType function returns the TWAIN data type for a particular capability  The return values are the same as defined by the Twain specification version 1.8.  The following are the possible return values:

 

Twain constant

Value

 

TWTY_INT8      

0

TWTY_INT16    

1

TWTY_INT32    

2

TWTY_UINT8  

3

TWTY_UINT16

4

TWTY_UINT32

5

TWTY_BOOL    

6

TWTY_FIX32    

7

TWTY_FRAME  

8

TWTY_STR32    

9

TWTY_STR64    

10

TWTY_STR128  

11

TWTY_STR255  

12

TWTY_STR1024

13

 

Please note:

DTWAIN_GetCapDataType is provided only for informational purposes.  Do not use the value returned by DTWAIN_GetCapDataType for any DTWAIN functions that involve setting or getting capability values.  For example, if you are calling DTWAIN_ArrayCreate or DTWAIN_RangeCreate for the purposes of setting values within these structures, the return value for DTWAIN_GetCapDataType can not be used as the datatype argument for these functions.  

 

Instead, call DTWAIN_GetCapArrayType to determine the proper DTWAIN data type to use when creating a DTWAIN_ARRAY or DTWAIN_RANGE, or more directly, call DTWAIN_ArrayCreateFromCap or DTWAIN_RangeCreateFromCap to create a DTWAIN_ARRAY or DTWAIN_RANGE that is compatible with DTWAIN capability functions..

 

The TWTY_xxx constants are found in the TWAIN.H header file that is included in the INCLUDE directory of the DTWAIN installation, can be obtained at the TWAIN Working Group at http://www.twain.org.  

 

Note that capability handling using the DTWAIN functions do not require your application to know the specific TWAIN types since DTWAIN_ARRAYs are used to retrieve or set capability information

 

For most cases, the Source argument should be NULL to DTWAIN_GetCapDataType. The only exception is if the capability is a custom capability, the Source argument to DTWAIN_GetCapDataType must be an open DTWAIN_SOURCE.  This is the only way that DTWAIN can determine the data type used for custom capabilities.

 

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