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

Show in webframe

Startup 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 that determines the Startup method behavior
Initializes the TWAIN session.
Syntax
'Declaration
 
Public Sub Startup( _
   ByVal owner As IntPtr, _
   ByVal manufacturer As String, _
   ByVal productFamily As String, _
   ByVal version As String, _
   ByVal application As String, _
   ByVal flags As TwainStartupFlags _
) 
'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
 
instance.Startup(owner, manufacturer, productFamily, version, application, flags)

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 that determines the Startup method behavior
Remarks
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 the user 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 Startup method there must be a call to the Shutdown method.

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, most likely you have an old version of TWAINDSM.DLL in your system folder. You need to 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 the thunk server (ltthunkserver.exe) failed to start. In this case you need to make sure ltthunkserver.exe is registered correctly and that all dependencies listed in Using LEADTOOLS THUNK Utility with TWAIN topic reside 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 StartupExample(ByVal parent As IntPtr)
   Dim session As TwainSession = New TwainSession()
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
   Try
      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 StartupExample(IntPtr parent)
{
   TwainSession session = new TwainSession();
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
   try
   {
      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
Shutdown Method
IsAvailable Method
Acquire Method
SelectSource Method

Error processing SSI file