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: Command line twain

Forums › TWAIN Classic › Command line twain › Reply To: Command line twain

July 21, 2007 at 2:26 pm #23971
gabe
Participant
  • Topics - 9
  • Replies - 583
  • Total Posts - 592

the main trick to getting twain to work with the commandline is the messagepump and handle that twain requires. console apps don’t pump messages the way that traditional gui apps do. The main workaround (that I’ve found) is the same one you would use if you wanted to work with twain from a service, as services lack a lot of the same things as console apps when it comes to working with twain. you create a class that inherits from nativeWindow to talk to twain for you.

from there, why is a simple app difficult… difficult isn’t quite the work I would use., maybe monotonous. With the 270ish seperate capabilities defines in the twain (without considering the custom capabilites that will end up being a whole seperate kind of pain later) and the conbination of dependancies for those caps you end up with miles of code. Or, you skip the idea of altering/setting caps one-by-one and instead you use the Ui that comes with the device for setup related stuff and then save the setup as a profile and later run all of the setting together. It’s a cleaner method, plus you no longer worry (as much) about dealing with devices that don’t quite follow the protocol. Instead you take the device’s Ui as thier contract (and don’t try to hold the vendors to a protocol that they more often than not don’t follow in the first place).

I hope that helps somewhat, but again if you want to see opentwain offer more from the console sample shoot me an IM or email.

.

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