Xscan40.dll and c#

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
joeitaliano
User
Posts: 89
Joined: Wed Dec 29, 2010 8:50 am

Xscan40.dll and c#

Post 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
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Xscan40.dll and c#

Post 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
Attachments
scanner_demo_c#.zip
(55.58 KiB) Downloaded 272 times
joeitaliano
User
Posts: 89
Joined: Wed Dec 29, 2010 8:50 am

Re: Xscan40.dll and c#

Post 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
Attachments
error.zip
(107.82 KiB) Downloaded 276 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Xscan40.dll and c#

Post 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
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: Xscan40.dll and c#

Post 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.
Post Reply