DTWAIN_GetVersion

Top  Previous  Next

The DTWAIN_GetVersion gets the version of DTWAIN that is currently running. This function has been deprecated, and applications should use the DTWAIN_GetVersionEx function.

 

DTWAIN_BOOL DTWAIN_GetVersion (

LPLONG

lpMajor,

LPLONG

lpMinor,

LPLONG

lpType );

         

Parameters

lpMajor

Pointer to returned major version number of DTWAIN library in use.

 

lpMinor

Pointer to returned minor version number of DTWAIN library in use.

 

lpType

Pointer to returned DTWAIN Library type (Limited, Demo, Retail, Static Library).

 

Return Values

TRUE if successful.  Gets the version of DTWAIN that is being used in the application.  If the function fails, FALSE is returned.

 

Comments

This function retrieves the major, minor, and type version of the currently used DTWAIN library.  The lpMajor, lpMinor, and lpType are pointers to LONG variables.

 

On return, the lpType will contain a value representing one or more of the values below.  The value in the left column represents a bit value in lpType.  If the bit value is 1, then this feature is enabled.

 

 

Bit value          

Definition

 

DTWAIN_DEMODLL_VERSION            

DTWAIN DLL Demo Version

DTWAIN_UNLICENSED_VERSION

DTWAIN DLL Retail (Unlicensed) Version

DTWAIN_COMPANY_VERSION            

DTWAIN DLL Company Version

DTWAIN_GENERAL_VERSION    

DTWAIN DLL General Version

DTWAIN_DEVELOP_VERSION    

DTWAIN DLL Developer's version

DTWAIN_LIMITEDDLL_VERSION

DTWAIN Limited Version

DTWAIN_STATICLIB_VERSION

DTWAIN Static library

DTWAIN_STATICLIB_STDCALL_VERSION

DTWAIN Static library (_cdecl version)

DTWAIN_PDF_VERSION

PDF option is available

DTWAIN_TWAINSAVE_VERSION

TwainSave option is available

DTWAIN_OCR_VERSION

OCR support is available

DTWAIN_ACTIVEX_VERSION

DTWAIN ActiveX version

DTWAIN_32BIT_VERSION

32-bit version of DTWAIN

DTWAIN_64BIT_VERSION

64-bit version of DTWAIN

DTWAIN_UNICODE_VERSION

Unicode version of DTWAIN

         

 

For example, to determine if the 32-bit demo DLL is running, a bitwise AND can be done with the returned type with the bit pattern being tested, then comparing if the result of this AND operation yields the bit pattern being tested.

 

LONG major, minor, type;

// create bitmask that describes demo version and 32-bit version

LONG bitMask = DTWAIN_DEMODLL_VERSION | DTWAIN_32BIT_VERSION;

 

// call function

DTWAIN_GetVersion( &major, &minor, &type );

 

// determine if we have 32-bit demo version by anding our bitmask with the returned flags,

// then testing if this result comes back equal to our bitmask.

if ( (type & bitMask) == bitMask )

{

    // this is the 32-bit demo version of DTWAIN

}

 

 

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

None