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

Show in webframe

Startup2 Method






The parent window handle, this cannot be NULL.
Optional name of the application's manufacturer.
Optional product family name.
Version information.
Optional application name.
Flag determines the Startup method behavior
Specifies which language to be shown in the UI
Specifies which country to be shown in the UI
Initializes the TWAIN session.
Syntax
'Declaration
 
Public Sub Startup2( _
   ByVal owner As IntPtr, _
   ByVal manufacturer As String, _
   ByVal productFamily As String, _
   ByVal version As String, _
   ByVal application As String, _
   ByVal flags As TwainStartupFlags, _
   ByVal language As TwainLanguage, _
   ByVal country As TwainCountry _
) 
'Usage
 
Dim instance As TwainSession
Dim owner As IntPtr
Dim manufacturer As String
Dim productFamily As String
Dim version As String
Dim application As String
Dim flags As TwainStartupFlags
Dim language As TwainLanguage
Dim country As TwainCountry
 
instance.Startup2(owner, manufacturer, productFamily, version, application, flags, language, country)

Parameters

owner
The parent window handle, this cannot be NULL.
manufacturer
Optional name of the application's manufacturer.
productFamily
Optional product family name.
version
Version information.
application
Optional application name.
flags
Flag determines the Startup method behavior
language
Specifies which language to be shown in the UI
country
Specifies which country to be shown in the UI
Remarks
Please note that a TWAIN session is a communication session between Leadtools.Twain and your TWAIN sources. The internal TWAIN session handle that is created provides access to this TWAIN session. This method must be called before calling any other methods that require a TWAIN session.
When the TWAIN session is no longer needed, it should be ended by calling the Shutdown method. For every call to the Startup2 method there must be a call to the Shutdown method. Use this method to specify the language and country in the UI.
If you pass the UseThunkServer flag to the flags parameter, then the Twain session will be initialized using the thunk server option. The thunk server is only recommended to be used if you are using a Twain device that does not have a 64-Bit driver while you are working on a 64-Bit operating system. In this case, this option will make it possible to detect and interact with your 32-Bit Twain driver/device from a 64-Bit process application.

Note: This method checks if the currently selected twain data source is TWAIN 2.x compliant or not, if not then it will load TWAIN 1.x data source manager (Twain_32.DLL) from your system and in this case the used twain version will be TwainVersion1, but if the selected data source is TWAIN 2.x compliant then TWAIN 2.x data source manager (TWAINDSM.DLL) will be loaded from your system and this case the used twain version will be TwainVersion2. This checking will be done ONLY if the SetVersion method was NOT called by the user. You can get the currently selected Twain version by calling GetVersion method.

Note: If this function throws a TwainExceptionCode::InvalidDll exception, it is likely because the TWAINDSM.DLL's version in your system folder is old. Make sure you have at least version 2.0.9.0 of this DLL. You can download it from www.twain.org.
Note: If this function throws a TwainExceptionCode::NotInitialized exception while the UseThunkServer flag is used, then most likely it is because the thunk server (ltthunkserver.exe) failed to start. In this case, make sure ltthunkserver.exe is registered correctly and all dependencies listed in Using LEADTOOLS THUNK Utility with TWAIN topic resides in the same folder where ltthunkserver.exe is located.
For more information, refer to Initializing a TWAIN Source.
For more information, refer to Freeing the TWAIN Session. For more information, refer to Using LEADTOOLS THUNK Utility with TWAIN.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Twain

Public Sub Startup2Example(ByVal parent As IntPtr)
   Dim session As TwainSession = New TwainSession()

   Try
      session.Startup2(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None, TwainLanguage.LanguageEnglish, TwainCountry.CountryUsa)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

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

public void Startup2Example(IntPtr parent)
{
   TwainSession session = new TwainSession();
   try
   {
      session.Startup2(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None, TwainLanguage.LanguageEnglish, TwainCountry.CountryUsa);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }

   session.Shutdown();
}
Requirements

Target Platforms

See Also

Reference

TwainSession Class
TwainSession Members
Shutdown Method
IsAvailable Method
Acquire Method
SelectSource Method

Error processing SSI file