L_TwainGetVersion

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainGetVersion(pTwainVersion)

TWAIN_VERSION * pTwainVersion;

the currently used twain version

Gets the version of TWAIN that is currently being used for this session.

Parameter

Description

pTwainVersion

When this function returns, this parameter will be updated with the TWAIN version currently used by this TWAIN session. For possible values, refer to the  TWAIN_VERSION enumeration.

Returns

SUCCESS

The function was successful.

!= SUCCESS

An error occurred. Refer to Return Codes.

Comments

Use this function to determine which version of TWAIN is currently being used by the TWAIN session.

Required DLLs and Libraries

LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files to be Included with your Application.

See Also

Functions:

L_IsTwainAvailableL_TwainSetVersionL_TwainGetSources

Topics:

Programming with LEADTOOLS TWAIN Functions

 

TWAIN Functionality: Property Functions

Setting which TWAIN Specification Version to use

Example

L_INT TwainGetVersionExample(HTWAINSESSION g_hSession) 
{ 
   L_INT nRet = TWAIN_SUCCESS; 
   // Show the Twain Select Source UI 
   nRet = L_TwainSelectSource(g_hSession, NULL); 
   if (nRet != SUCCESS) 
   { 
      MessageBox (NULL, TEXT("Error occurred while selecting the source."),TEXT( "ERROR"), MB_OK); 
      return nRet; 
   } 
   // Get the supported TWAIN version of the selected twain source 
   TWAIN_VERSION TwainVersion; 
   nRet = L_TwainGetVersion(&TwainVersion); 
   if (nRet != SUCCESS) 
   { 
      MessageBox (NULL, TEXT("Failed to get twain version"), TEXT("ERROR"), MB_OK); 
      return nRet; 
   } 
   if(TwainVersion == TWAIN_VERSION1) 
      MessageBox (NULL, TEXT("Currently using TWAIN 1.x version"), TEXT("INFORMATION"), MB_OK | MB_ICONINFORMATION); 
   else 
      MessageBox (NULL, TEXT("Currently using TWAIN 2.x version"), TEXT("INFORMATION"), MB_OK | MB_ICONINFORMATION); 
   return nRet; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS TWAIN C API Help