Twain scanner works fine on 32-bit but not on 64-bit

-2

I'm using this example for scan twain .NET TWAIN image scanner

But when I try running my project on a 64-bit system, its giving me this error:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

According to many searches that I have made, I found the twaindsm.dll. I tried to import it but the system becomes stuck.

I tried to build the project in 32-bit, and that didn't worked either.

Any help?

c#
twain
asked on Stack Overflow Oct 16, 2012 by Adir.el • edited Sep 17, 2013 by LarsTech

4 Answers

1

Twain DLL are for 32 bit system wich basicly wont work on 64 bit.

answered on Stack Overflow Jun 4, 2013 by Adir.el • edited Jun 4, 2013 by Flexo
1

You can find the 64 bit version of the TWAINDSM DLL. While installing your application make sure this DLL is in the same folder as your exe and make sure you load this manager.

In 64 bit systems the default twain32 dll sits under C:\Windows. Hence when the TWAIN app loads this module it loads the 64 bit version. Always the best way to avoid DLL resolution conflicts with TWAIN is to port your DSM as part of it. That way it works everywhere.

answered on Stack Overflow Mar 13, 2017 by Preeth Pratheek
-1

Change Platform target to x86 from project properties.

answered on Stack Overflow Sep 17, 2013 by C J
-1

Twain DLL are for 32 bit system wich basicly wont work on 64 bit.

Agree, this is the cause of the problem.

Here is the solution: Access Scanners from 64bit Applications

Asprise Scanning C# VB.NET TWAIN WIA Scan SDK is probably the only scanning library that works for both 64bit and 32bit applications thanks to the innovative patent pending technology and quality implementation.

You may obtain the library from NuGet directly:

enter image description here Install-Package asprise-scan-scanner-twain-wia-api

Here is the documentation to C# VB.NET Twain Scanning Library API.

answered on Stack Overflow Aug 19, 2016 by Asprise Support

User contributions licensed under CC BY-SA 3.0