Leadtools TWAIN (Leadtools.Twain assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
Startup Method
See Also 
Leadtools.Twain Namespace > TwainSession Class : Startup Method



owner
The parent window, this may not 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
owner
The parent window, this may not 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
Initializes the TWAIN session.

Syntax

Visual Basic (Declaration) 
Public Sub Startup( _
   ByVal owner As IWin32Window, _
   ByVal manufacturer As String, _
   ByVal productFamily As String, _
   ByVal version As String, _
   ByVal application As String, _
   ByVal flags As TwainStartupFlags _
) 
Visual Basic (Usage)Copy Code
Dim instance As TwainSession
Dim owner As IWin32Window
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)
C# 
public void Startup( 
   IWin32Window owner,
   string manufacturer,
   string productFamily,
   string version,
   string application,
   TwainStartupFlags flags
)
C++/CLI 
public:
void Startup( 
   IWin32Window^ owner,
   String^ manufacturer,
   String^ productFamily,
   String^ version,
   String^ application,
   TwainStartupFlags flags
) 

Parameters

owner
The parent window, this may not 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

Example

Visual BasicCopy Code
Public Sub StartupExample(ByVal parent As IWin32Window)
   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
C#Copy Code
public void StartupExample(IWin32Window 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();
}

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 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 end by calling the Leadtools.Twain.TwainSession.Shutdown method. For every call to the Leadtools.Twain.TwainSession.Startup method there must be a call to the Leadtools.Twain.TwainSession.Shutdown method. Note: If this function throw TwainExceptionCode::InvalidDll exception then this is mostly because 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.
For more information, refer to Initializing a TWAIN Source.
For more information, refer to Freeing the TWAIN Session.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also