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

Reply To: Try to Open data source when it is powered off….

Forums › TWAIN Classic › Try to Open data source when it is powered off…. › Reply To: Try to Open data source when it is powered off….

May 7, 2007 at 10:06 am #23249
gabe
Participant
  • Topics - 9
  • Replies - 583
  • Total Posts - 592

ok, double checked. Seems that even with drivers that I normally consider well behaved I’m not able to check cap_deviceonline until I open the source ~ which is too late to care what the response is in many cases.

Back to the part of your question where you asked if I have a solution. Yes.. no.. a bit. I have a workaround. It isn’t a twain workaround, just a general windows programming workaround. I use a cbthook and a bit of polling to determine whether any new dialogs have been launched in 3 different places in my code. Whenever I am about to call OpenDs, EnableDs or EnableDsUiOnly – I record all of the open dialogs and set the cbtHook. I keep polling until the call is finished at which point I stop polling and remove the cbtHook. If any new dialogs are detected my code checks the details of the dialog and if they match the details for any dialog in my “known dialog” list, my code sends the “known response” to the dialog. The users have instructions to ‘train’ my app where they do various things that cause dialogs to come up – unplug the device and try to scan, cause ampaper jam and try to scan etc… After the training is complete they create rules of the unwanted dialogs and when a dialog would have come up and interupted their scanning at most they get a brief flash on screen and hear the error. Usually the cbthook closes the dialog before it even comes onscreen.

I wrapped all the dialog managment into my twain library, as I feel strongly that (unfortunately) dialog management is a part of twain’s problem domain. The .net code is open source and available over at http://www.codeplex.com/opentwain

.

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