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

Multi thread

Forums › TWAIN Classic › Multi thread

  • This topic has 3 replies, 4 voices, and was last updated 10 years, 3 months ago by dpenney.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 31, 2006 at 12:18 pm #21906 Reply
    Anonymous
    Participant
    • Topics - 60
    • Replies - 107
    • Total Posts - 167

    Is possible to manage a twain session inside a DLL without using the window message loop of the application ?
    I’ve tried this creating a secondary thread inside the DLL which create a hidden window and I pass this window handle on the OPENDSM message.
    The application using a DLL funciton start the image scan ( MSG_ENABLEDS ) , and the secondary
    thread receive the msg MSG_XFERREADY on your message loop and process all the scanning data, but when I exec the MSG_ENDFER msg this command remain blocked forever.
    can help me please ?
    thanks
    steven

    January 10, 2011 at 9:00 pm #23300 Reply
    mcbacker
    Participant
    • Topics - 1
    • Replies - 1
    • Total Posts - 2

    I would like to know that also… if i go multithread the GetMessage can’t receive the proper messages in the secondary thread.

    I don’t want to lock the main app while waiting for the scan to complete… any help guys?

    Nobody never answer my questions… 😆

    January 11, 2011 at 1:39 pm #23301 Reply
    fct
    Participant
    • Topics - 0
    • Replies - 24
    • Total Posts - 24

    Depending on the driver it should work. I’ve successfully done that with Fujitsu, Panasonic and Kodak scanners. HP on the other hand caused lots of problems so it’s not supported in our app.

    Greets.

    January 11, 2011 at 6:03 pm #23302 Reply
    dpenney
    Participant
    • Topics - 3
    • Replies - 66
    • Total Posts - 69

    Wow, a 4+ year-old thread revived.

    The TWAIN spec doesn’t seem to cover reentrancy or multithreading. Note that messages may be posted to the wrong message queue if TWAIN is called from a thread other than the one which owns its window. This can result in unresponsive UI or deadlocks (e.g. XFERREADY is never received). For maximum compatibility a process should make all TWAIN calls from a single thread: the one that owns the parent window provided to TWAIN. The thread that calls TWAIN does not have to be the app’s main UI thread; it can be a worker thread with it’s own message loop.
    –

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Multi thread
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

  • TWAIN for dental imaging integration
  • PDF/R For who and where?
  • Making searchable PDF with PDF/R
  • Backward compatibility with PDF/A and traditional PDF
  • could not open the twain source. Make sure there is a valid source for your sca
  • 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.