VintaSoft Twain ActiveX v6.0
In This Topic
    TWAIN device manager
    In This Topic

    TWAIN device manager is the library, which serves as a bridge between a TWAIN driver and user application (VintaSoft Twain ActiveX).

    The following TWAIN device managers are presented at current time:

    1. TWAIN_32.DLL - 32-bit TWAIN device manager compatible with TWAIN 1.x specification.
      This device manager allows to work only with 32-bit TWAIN 1.x and WIA drivers.
      Normally TWAIN_32.DLL is located in "C:\Windows\" directory and included in distributive package of all versions of Windows.

    2. TWAINDSM.DLL and TWAINDSM32.MSM - 32-bit TWAIN device manager compatible with TWAIN 2.x specification.
      This device manager allows to work only with 32-bit TWAIN 1.x and 2.x drivers.
      Files of this device manager are NOT included in distributive package of Windows. On 32-bit systems the TWAIN device manager files must be placed in "C:\Windows\System32\" directory. On 64-bit systems the TWAIN device manager files must be placed in "C:\Windows\SysWow64\" directory.
      Latest version of this device manager can be found here:
      http://www.twain.org or http://sourceforge.net/projects/twain-dsm/files/.

    3. TWAINDSM.DLL and TWAINDSM64.MSM - 64-bit TWAIN device manager compatible with TWAIN 2.x specification.
      This device manager allows to work only with 64-bit TWAIN 2.x drivers.
      Files of this device manager are NOT included in distributive package of Windows. On 64-bit systems the TWAIN device manager files must be placed in "C:\Windows\System32\" directory.
      Latest version of this device manager can be found here:
      http://www.twain.org or http://sourceforge.net/projects/twain-dsm/files/.


    Unfortunately, there is no TWAIN device manager that can work with 32-bit and 64-bit drivers at the same time and you must choose between 32-bit and 64-bit drivers. We recommend to use 32-bit drivers because most of scanners does not have 64-bit drivers.


    For working with TWAIN device manager it is necessary to select the manager type and open the manager. Type of TWAIN device manager can be set using the DeviceManager_IsTwain2Compatible property. DeviceManager_IsAvailable property allows to check if TWAIN device manager is present in the system. The DeviceManager_DllPath property allows to define custom path to TWAIN device manager. TWAIN device manager can be opened using the DeviceManager_Open method.

    Here is an example that shows how check if TWAIN device manager is installed in the system:

    Private VSTwain1 As New VintaSoftTwain()
    
    
    ''' <summary>
    ''' Checks that TWAIN device manager is installed in the system.
    ''' </summary>
    Public Sub CheckTwain()
        Dim isTwainAvailable As Boolean = False
    
        If VSTwain1.DeviceManager_IsAvailable Then
            Console.WriteLine("TWAIN device manager 1.x is available.")
            isTwainAvailable = True
        End If
    
        VSTwain1.DeviceManager_IsTwain2Compatible = True
        If VSTwain1.DeviceManager_IsAvailable Then
            Console.WriteLine("TWAIN device manager 2.x is available.")
            isTwainAvailable = True
        End If
    
        If Not isTwainAvailable Then
            Console.WriteLine("TWAIN device manager is NOT available.")
        End If
    End Sub