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

Strategy to persist scanner for reuse – no device selection

Forums › TWAIN Classic › Strategy to persist scanner for reuse – no device selection

  • This topic has 1 reply, 2 voices, and was last updated 5 years, 1 month ago by MarkM.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 16, 2015 at 11:26 pm #23040 Reply
    GroundLoop
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Coding in C# and looking for the best way to persist the current used scanner for re-use. In WIA a guid is created and all you need to do is persist the value and then populate the value when needed. I am relatively new to TWAIN but did download some sample code and have an idea of what properties are available. I know when a scanner is detected the manufacturer, product family and product name are populated. I see an Id is populated but it does not appear to be a derived value. Is there a different strategy for TWAIN I am not seeing? Thanks in advance.

    December 17, 2015 at 3:10 pm #26341 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Your request is a little vague, but based on your WIA example I’m assuming that you’d like to establish the default TWAIN Driver, or at least have programmatic control of which one is opened.

    If you control the scanner application the simplest way to do this is to specify the TW_IDENTITY.ProductName when you call DG_CONTROL / DAT_IDENTITY / MSG_OPENDS. You can get this value by enumerating through the available TWAIN drivers using DG_CONTROL / DAT_PARENT / MSG_GETFIRST and DG_CONTROL / DAT_PARENT / MSG_GETNEXT.

    It’s also possible to set the default using DG_CONTROL / DAT_IDENTITY / MSG_SETDEFAULT, but this only works with the TWAINDSM.DLL module, and only makes sense if you can’t guarantee control of the applications that will use the scanner.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Strategy to persist scanner for reuse – no device selection
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

  • Hello world
  • Girls of Desire: All babes in one place, crazy, art
  • 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
  • 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.