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: Software to run as service on NT terminal server

Forums › TWAIN Classic › Software to run as service on NT terminal server › Reply To: Software to run as service on NT terminal server

March 16, 2006 at 9:50 pm #23267
gabe
Participant
  • Topics - 9
  • Replies - 583
  • Total Posts - 592

Running twain as service is a bit tricky, and i don’t think all twain devices are good candidates for that setup – this may be one of the reasons that you current isn’t offered as a service.
From the twain spec, twain_32.dll wants a handle to the window calling the dll, and a lot of the requirements for setting up and controling a device via twain has to do with modifying the applications message pump to communicate with twain. the kicker is that windows services don’t by default have a message pump, essage pumps are more typically found in applications that windows.
Running twain as a service is an odd contradiction, running an app to access twain (which requires something typically associated with a window) in an enviroment not really setup to have a window running. Don’t get me wrong, it can be done, but its just going to be a bit odd. My solution was to have the service create a window (that isn’t shown) and using that window’s message pump to communicate with twain.
Then there is a problem with some devices wanting to put up a messagebox, to inform the user that something went wrong. Some devices, when they put up that messagebox, don’t process anything more until the OK button is clicked. They don’t even give the application a return code or condition code that something is wrong, until that messagebox’s OK button is clicked. This too, can be somewhat avoided if you understand the device – or are just dead sure that the device doesn’t put up any messageboxes. I’ve emailed HP to see of that scanner ever puts but messageboxes, and I’ll post their reply if and when i recieve it.

Hope that in some way provides a bit of the advise you’re looking for.

gabe

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