Home › Forums › TWAIN Classic › Calls from DS to DSM fail
- This topic has 1 reply, 1 voice, and was last updated 13 years, 5 months ago by smadash.
- AuthorPosts
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
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
- AuthorPosts