Error processing SSI file
Leadtools TWAIN (Leadtools.Twain assembly)

Show in webframe

SetVersion Method






The TWAIN version to set, see TwainVersion for a list of available versions.
Sets the desired TWAIN version with which to work.
Syntax
public static void SetVersion( 
   TwainVersion twainVersion
)
'Declaration
 
Public Shared Sub SetVersion( _
   ByVal twainVersion As TwainVersion _
) 
'Usage
 
Dim twainVersion As TwainVersion
 
TwainSession.SetVersion(twainVersion)
public:
static void SetVersion( 
   TwainVersion twainVersion
) 

Parameters

twainVersion
The TWAIN version to set, see TwainVersion for a list of available versions.
Remarks
This method overrides the default TWAIN (version 2) used for scanning. This allows the TWAIN version to be changed without having to rename or delete any of the TWAIN version DLLs from the system directory. The TWAIN version 1 DLL name is Twain_32.dll and the version 2 DLL name is TWAINDSM.DLL. If this method is not called the engine will keep the default behavior and look for TWAIN version 2 first. If version 2 does not exist it will then look for TWAIN version 1.
If this method is called and returns SUCCESS there is no need to call Leadtools.Twain.TwainSession.IsAvailable since this internally calls it. For more information, refer to SettingWhichTWAINSpecificationVersiontoUse.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Twain

Public Sub SetVersionExample(parent As IntPtr, twainVersion As TwainVersion)
   Dim session As New TwainSession()
   Try
      TwainSession.SetVersion(twainVersion)
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

   session.Shutdown()
End Sub
using Leadtools;
using Leadtools.Twain;

public void SetVersionExample(IntPtr parent, TwainVersion twainVersion)
{
   TwainSession session = new TwainSession();
   try
   {
      TwainSession.SetVersion(twainVersion);
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }

   session.Shutdown();
}
Requirements

Target Platforms

See Also

Reference

TwainSession Class
TwainSession Members
IsAvailable Method

Error processing SSI file