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

Problem with TwainDotNetProject and CanoScan Lide 110

Forums › TWAIN Classic › Problem with TwainDotNetProject and CanoScan Lide 110

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 5 months ago by MarkM.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 15, 2012 at 1:25 pm #22790 Reply
    bzden50
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Hello,
    My question may be stupid or irrelevant because I am a newcomer to TWAIN, so please forgive me for that.

    I am using the TwainDotNet project (http://code.google.com/p/twaindotnet/) for WPF and with all the scanners I tried it works fine, except one: Canoscan Lide 110. In it’s case the application stucks on the “warming up” splash screen.

    Trough some debug I discovered that the application goes into an infinite loop because in this code block:

    TwainResult result = Twain32Native.DsEvent(
    ApplicationId,
    DataSource.SourceId,
    DataGroup.Control,
    DataArgumentType.Event,
    Message.ProcessEvent,
    ref _eventMessage);

    if (result == TwainResult.NotDSEvent)
    {
    handled = false;
    return IntPtr.Zero;
    }

    the “result” variable always gets “NotDSEvent”.

    Have no idea how to solve this, so any help will be highly appreciated.

    October 24, 2012 at 3:55 pm #25716 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    From a defensive programming standpoint, the safest way to access the scanner is from a process that separate from your main application. That way if the scanner process hangs or crashes, it doesn’t take out the application. That doesn’t solve the problem, though, it just makes it easier to recover.

    TwainResult.NotDSEvent is part of the TWAIN protocol. When an application asks a data source to begin scanning or bring up its GUI, then it’s supposed to redirect all Windows messages to the driver, so that the driver’s GUI has first crack at any messages. Just moving the mouse around your application should be enough to generate that response from the driver.

    Essentially, TwainResult.NotDSEvent is the TWAIN driver saying “that Windows message doesn’t belong to me, so you can have it back.”

    Make sure that you only use one thread to access the TWAIN driver (the same thread that opened the driver). Also, try moving the mouse over the splash screen to see if that makes a difference. I don’t recommend accessing a TWAIN driver from your main application thread, create a thread that’s dedicated to communicating with the scanner.

    Finally, contact Canon and/or the Twain Dot Net forum for more help…

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Problem with TwainDotNetProject and CanoScan Lide 110
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

  • 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
  • Changing TWAIN driver defaults
  • 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.