Home › Forums › TWAIN Classic › Problem running on Window 8.1
- This topic has 5 replies, 2 voices, and was last updated 9 years, 9 months ago by Eugene.
- AuthorPosts
Hi all,
I’m getting an exception when trying to run my application on a Windows 8.1 64-bit machine.
The messages is as follows
“Attempted to read or write protected memory. This is often an indication that other memory is corrupt”.
It works fine on Windows 7 64-bit.
The twain log is as follows. I’m not too familiar what the log message means.
Any help would be appreciated and thanks in advance.
TWAIN_32.DLL – MESSAGE – CTwunk ::AppInitialize – Reset Log
TWAIN_32.DLL – MESSAGE – CTwunk ::OpenServer – Starting Thunker
TWAIN_32.DLL – MESSAGE – CTwunk ::CloseServer – Why Can’t We Find The Thunker Window?
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to NULL:
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, IDENTITY, GETDEFAULT
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to NULL:
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, IDENTITY, GETFIRST
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to NULL:
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, IDENTITY, GETNEXT
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to NULL:
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, IDENTITY, GETNEXT
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 7, CC = 0)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to EPSON DS-5500/6500/7500(56):
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, USERINTERFACE, DISABLEDS
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 1, CC = 0)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to NULL:
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, IDENTITY, CLOSEDS
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 1, CC = C568)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to WIA-EPSON DS-5500/6500/7500(57):
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, USERINTERFACE, DISABLEDS
TWAIN_32.DLL – MESSAGE – DSM –DsmEntryDiagExit (RC = 1, CC = C568)
TWAIN_32.DLL – MESSAGE – CTWTRACE–TwainDotNet(55) to NULL:
TWAIN_32.DLL – MESSAGE – CTWTRACE–CONTROL, IDENTITY, CLOSEDS
Found my problem. Was due to the way the source was being closed.
I used CloseDSOK with Windows 8 and CloseDS with Windows 7.
When closing the source with CLOSEDSOK I get another problem.
It fails to OPENDS when closed this way.
Anybody else run into this problem?
The CloseDSOK is actually not working on windows 8 and the CloseDS causes a memory access issue.
All out of ideas here.
Ok I got it to work correctly on Windows 8 with the new TwainDSM.dll.
New problem is that this library isn’t picking up the WIA deivces. The one default library that comes with windows does.
Seem to be having a conversation with myself here but going to put these replies to help other people with these problems.
TOR, thanks for your post. I am experiencing similar issue as you had. However after I switched to twaindsm.dll, my program returns failure when try to OpenDSM. I am wondering whether the MarshalAs in the Identity struct need to be change after swtitch from twain_32.dll to twaindsm.dll. I would like apprecite any advice from you. Thanks.
The following is part of code.
1) Returns failure
DSMparent(appid, IntPtr.Zero, TwDG.Control, TwDAT.Parent, TwMSG.OpenDSM, ref hwndp)2) Dll Import for the function
[DllImport(“twaindsm.dll”, EntryPoint = “DSM_Entry”, CharSet = CharSet.Ansi)]
private static extern TwRC DSMparent([In(), Out()]
TwIdentity origin, IntPtr zeroptr, TwDG dg, TwDAT dat, TwMSG msg, ref IntPtr refptr);3) Definition of Identity Struct
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)]
public class TwIdentity
{
// TW_IDENTITY
public IntPtr Id;
public TwVersion Version;
public short ProtocolMajor;
public short ProtocolMinor;
public int SupportedGroups;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)]
public string Manufacturer;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)]
public string ProductFamily;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)]
public string ProductName;
}- AuthorPosts