LTwain::SetVersion

#include "ltwrappr.h"

virtual L_INT LTwain::SetVersion(TwainVersion)

TWAIN_VERSION TwainVersion;

twain version to set

Sets the desired Twain version to work with.

Parameter

Description

TwainVersion

The desired Twain version to work with. For possible values, refer to TWAIN_VERSION enumeration.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function is used to override the default Twain version (which is TWAIN v2.0).

Using this function, there is no need to rename or delete any of the Twain version DLLs from the system directory. The TWAIN v1.0 DLL name is "Twain_32.dll" and TWAIN v2.0 DLL name is "TWAINDSM.DLL". If this function is not called the engine will keep the default behavior which is looking for TWAIN v2.0 first, and if it doesn't exist then look for TWAIN v1.0.

If the function returned SUCCESS, there is no need to call LTwain::IsAvailable function since it will be called internally.

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:

LTwain::IsAvailable

Topics:

Programming with LEADTOOLS TWAIN Functions

 

TWAIN Functionality: Property Functions.

Setting Which TWAIN Specification Version to Use

Example

L_INT LTwain__SetVersionExample(TWAIN_VERSION TwainVersion) 
{ 
   L_INT nRet; 
   LTwain MyClass; 
   APPLICATIONDATA AppData; 
   nRet = MyClass.SetVersion(TwainVersion); 
   if(nRet != SUCCESS) 
   { 
      MessageBox (NULL, TEXT("Failed to set Twain version"), TEXT("ERROR"), MB_OK); 
      return nRet; 
   } 
   AppData.uStructSize = sizeof(APPLICATIONDATA); 
   lstrcpy (AppData.szManufacturerName, TEXT("LEAD Technologies, Inc.")); 
   lstrcpy (AppData.szAppProductFamily, TEXT("LEAD Test Applications")); 
   lstrcpy (AppData.szVersionInfo, TEXT("Version 1.0")); 
   lstrcpy (AppData.szAppName, TEXT("TWAIN Test Application")); 
   AppData.uLanguage = TWLG_ENGLISH_USA; 
   AppData.uCountry = TWCY_USA; 
   nRet = MyClass.InitSession(&AppData); 
   if (nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

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