TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Weird behaviour using different TWAIN DSM Versions.

Forums › TWAIN Classic › Weird behaviour using different TWAIN DSM Versions.

  • This topic has 1 reply, 2 voices, and was last updated 4 years, 5 months ago by MarkM.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 20, 2016 at 5:50 am #23058 Reply
    pdabhi@argusoft.com
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Hi,

    I have this TWAIN DS that works with my Web Camera. To test it I use two applications given out by TWAIN. The Standard Windows Console based Twain Application (uses TWAINDSM.dll Version 2.3.0.0) using twain.h of version 2.3 and the TWAIN Twacker Application (uses TWAIN_32.dll Version 1.07.1.3) using twain.h of version 2.0 and using ProtocolMajor as 1 and Protocol Minor as 9 in TW_IDENTITY of the Application. I am on Windows 64 bit windows 8 but using

    When I use the Twacker Application by using the following settings

    1. TWAIN 2.0 -> Unselected.
    2. SHOWUI -> Unselected.
    3. Memory (Transfer Mode).

    I am able to capture the image. During the call to DSMEntry with DG_IMAGE, DAT_IMAGEINFO, MSG_GET the TW_IMAGEINFO has ImageWidth to 640 and ImageHeight to 480 (might be the default values as I did not GET/SET any capabilities for the device).

    Now begins the problem, when I use the same configuration and use the Console Application (which I build from the source) it is unable to capture the image and crashes. The reason behind this is that the call with DG_IMAGE, DAT_IMAGEINFO, MSG_GET return the TW_IMAGEINFO with ImageWidth and ImageHeight set to 0. Then, I set the ShowUI to TRUE in TW_USERINTERFACE structure during the call with DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDS. During capture, I got the UI and was able to capture the image got the proper ImageWidth and ImageHeight.

    I need to create an Application that can scan documents using TWAIN. Now I am confused as whether to go according to 2.3 specifications or 1.9? As one can capture from my camera and other does not using the same setting.

    Any advice on this would be highly appreciated. As I don’t want to hit a roadblock later in the code.

    Best Regards

    August 17, 2016 at 5:30 pm #26386 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Two things…

    DAT_IMAGEINFO must be called in state 7 after TWRC_XFERDONE is returned by one of the DAT_IMAGE*XFER calls. Anything prior to that is not required to return complete or correct information.

    TWAIN is forward and backwards compatible, there are some changes that occur with the versions (especially going from 1.9 to 2.0), but in most cases these can be ignore on the application side. The TWAIN Spec tries to call all of these out in one chapter.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Weird behaviour using different TWAIN DSM Versions.
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.