Home › Forums › TWAIN Classic › Windows 8.1 and Visual studio 2013 fails on CloseDS
- This topic has 1 reply, 2 voices, and was last updated 10 years, 1 month ago by MarkM.
- AuthorPosts
I have used twain library to scanning my document in my application and its worked just fine in windows 7. After the upgrade to windows 8.1, i have been getting this error on CloseDS “Attempted to read or write protected memory” has occurred. Twain is trying to close communication with scanner by accessing CloseDS memory bit (0x0402). Anyone else has encounter this problem? if i change the Message.CloseDS to Message.CloseDSOk. it works fine.
result = Twain32Native.DsmIdentity(
_applicationId,
IntPtr.Zero,
DataGroup.Control,
DataArgumentType.Identity,
Message.CloseDS,
SourceId);Thank you very much in advance
There are three likely possibilities:
– the application has done something to memory that is causing the DSM or the driver to crash
– the DSM has a problem
– the driver has a problemIf the application is using TWAIN_32.DLL, then the easiest thing to try first is to switch to TWAINDSM.DLL and see if that resolves the problem. This is the newer, fully supported DSM maintained by the TWAIN Working Group. TWAIN_32.DLL is a legacy binary that is no longer under the control of the TWG. You can get the newer DSM here: http://sourceforge.net/projects/twain-dsm/
Using it is easy, just install it and switch from using TWAIN_32.DLL to TWAINDSM.DLL. The newer DSM is 100% compatible with all TWAIN applications and drivers of any version. It’s also open source, so you can debug into it.
If that doesn’t resolve the problem, then try running a different TWAIN application. If the problem reproduces, then it’s likely that the driver has a problem. Contact the scanner manufacturer for help.
If the problem does not reproduce with a different application, then it might be a problem with your application. In that case turn on logging for the TWAINDSM.DLL (set the TWAINDSM_LOGPATH environmental variable to a valid path and file name), and compare the calls made by your application to the ones made by the other application. There may be clues as to what’s going on.
Good luck…
- AuthorPosts