We have developed an application to control and scan any file like images, etc as a C# Winform App and it works under x86 OS platform successfully. In the app, we use C# twain class which to send a command to scanner so we can achieve what we want. As you all know, Twain_32.dll file is used to run the app and scan without failure.
My question is, in x64 OS platforms, we can not run the app and get an error called BadImageFormatException that tries to tell us it's all about OS type! So this error points me that i try to run the app under uncompatible OS type.
I have experienced that 32 bit twain dll work under x64 systems but another problem cross my way. We run our all applications under one parent form which is MDI Parent form. So The form that I wanna use as scan purposes will be an MDI Client form. So well, while my program is compiled as ANYCPU, CLR will run it as x64 bit app in Windows x64 OS. That's why, I can not run the app even if I compiled my scanning form as x86 platform target in x64 Win OS.
Till here, I hope you all got what i mean!!!
As a solution, I tried to install Twack64 setup file to get TWAINDSM.dll file and to run my app both in x86 and x64 OS machines. Also, in my custom twain source project, I changed to dll import attribute TWAINDSM.dll instead of Twain_32.dll but it didn't work out.
So am i missing something here or Twain C# app does not recognize TWAINDSM.dll as twain dll? I got stuck at this step and can not go forward any further!!! pulling my hair for 3-4 days!!! :(
A quick hand will be great help to me guys! Looking forward to hearing from you!!!