Page 1 of 1

Xscan40.dll and c#

Posted: Fri Oct 23, 2015 3:04 am
by joeitaliano
Hi Support,

Just downloaded the latest PDF-XChange Pro SDK V5 (version 5.5.315.0) and tried out your scanner samples.

It seems the c# sample (CS_ScannerDemo.exe) doesn't work.
Comes up with a message box when creating twain or wia object that says:
"An attempt was made to load a program with an incorrect format (Exception from HResult: 0x800700B)"

I tried recompiling the c# sample with VS 2008 and VS 2013 and same error occurs.

Do you have an updated scanner demo for C# that works?

Thanks
Joe

Re: Xscan40.dll and c#

Posted: Fri Oct 23, 2015 12:00 pm
by Tracker Supp-Stefan
Hello Joe,

The scanner demo project compiles perfectly fine for me (VS2010) - please see the attached screenshot.
Have you made any changes to the project (e.g. compiling for a specific CPU only)?

Regards,
Stefan

Re: Xscan40.dll and c#

Posted: Sat Oct 24, 2015 6:43 am
by joeitaliano
Hi Stefan,

Thanks for the reply.
No, haven't made any changes to the source code - in fact the error occurs with the version that is installed in PDF-XChange PRO 5 SDK\Examples\Bin folder

Attached screen shot that shows CS_ScannerDemo.exe program run from the installled files, and the error that comes up. It works fine for the VB and C++ versions however, which have the same date (15th Feb 2008). Is the VS2010 project you tried the same as the one the SDK installer installs? If there are any differences, perhaps you could zip up your project and send to me.

I've also tried installing on another drive just in case it was windows/UAT trying to protect c:\program files\ directory just in case the c# version needed different permissions to the VB or c++ versions, but this made no difference as I got the same error.


Regards
Joe

Re: Xscan40.dll and c#

Posted: Mon Oct 26, 2015 4:31 pm
by Tracker Supp-Stefan
Hi Joe,

Yes - it seems like an issue with the project indeed. Even the pre-compiled copy that is in
C:\Program Files\Tracker Software\PDF-XChange PRO 5 SDK\Examples\Bin\CS_ScannerDemo.exe
Doesn't work properly, while other scanner demos from other languages are correct.

I will ask our devs that worked on those projects to take a look and investigate why this is happening.

Regards,
Stefan

Re: Xscan40.dll and c#

Posted: Mon Oct 26, 2015 5:41 pm
by Roman - Tracker Supp
Hi Joe,
This is because the C# demo (that has been compiled as a platform independent module) runs in 64-bit process on your machine and tries to load 32-bit xcscan40.DLL.
As a temporary solution you can move CS_ScannerDemo.exe to your "PDF-XChange PRO 5 SDK\Examples\Bin.x64" directory.