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

Calls from DS to DSM fail

Forums › TWAIN Classic › Calls from DS to DSM fail

  • This topic has 1 reply, 1 voice, and was last updated 10 years, 2 months ago by smadash.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 2, 2010 at 7:53 pm #22641 Reply
    smadash
    Participant
    • Topics - 1
    • Replies - 1
    • Total Posts - 2

    I am writing a TWAIN source. In two cases I need to call the DSM:
    1) When an image has been captured: DSM_Entry(… MSG_XFERREADY.. )
    2) When the source UI should be closed: DSM_Entry(… MSG_CLOSEDSREQ..

    The data source usually works fine. But with a specific application the OpenOffice writer running on XP SP2, calling DSM_Entry() fails, the return value is 1, and the notification does not reach the application. I have seen this problem with other applications also.
    Other applications, running on the same machine, works fine.
    The OpenOffice writer running on a Vista machine with the same driver works fine.
    The data source is TWAIN 1.9 ( I tried changing to 2.1, and the behavior is the same ).

    I appreciate it if someone can give me a direction.

    Thanks

    Asher

    November 7, 2010 at 11:37 am #25340 Reply
    smadash
    Participant
    • Topics - 1
    • Replies - 1
    • Total Posts - 2

    Issue is resolved.

    Apparently in some versions of Windows, TWAIN_32.DLL may be located in more then one location. Specifically with XP SP2 I found it in its designated location i.e. and also in system32. So, the application which loads modules from both locations loaded the copy that was located in system32, while the data source call to LoadLibrary(“TWAIN_32.DLL”) ended up loading the copy from . So the DS and the application were not connected, this why the notifications from the DS did not reach the application.

    The way I solved it was to load the same copy of the TWAIN_32.DLL that the application has loaded. Since the DS is also a DLL loaded by same process, I got the list of modules loaded by the application, searched for “TWAIN_32.DLL” or “TWAINDSM.dll”, get the full path of the module and call my LoadLibrary() with the same path the application used.
    After that everything worked just fine.

    Asher

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Calls from DS to DSM fail
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

  • 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

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.