L_TwainGetVersion

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainGetVersion(pTwainVersion)

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

Parameters

TWAIN_VERSION * 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

Value Meaning
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

See Also

Functions

Topics

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 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C API Help