[C# 4.0 - WPF] : methods TwainSelectSource() failure.

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
Dr3w
Posts: 22
Joined: Fri Nov 09, 2012 6:22 pm

[C# 4.0 - WPF] : methods TwainSelectSource() failure.

Post by Dr3w » Fri Nov 16, 2012 7:24 pm

Hi at all.
I'm using GdPicture.Net Twain methods to manage documents acquisition in my app.
During the initial configuration (i search for default device) if the method (TwainOpenDefaultSource()) fails (returns 0)...
I'll search for manual selection (via TwainSelectSource() method...)...

Now... is it possible this method works on 32bit machine, and not on 64bit?

I've tested that on 3 32bit machines and on 2 64bit machines (...after 2 hours of checks)...
During the test on 32bit machines I've not had problems... On 64bit machines, it not works.

My 'final-test' code:

Code: Select all

public Boolean SelectScanner() 
            {
                Boolean _res= this.Device.TwainSelectSource(this._windowHandle);
                if(!_res)
                    MessageBox.Show(String.Concat("Err - stat lib",this.Device.GetStat().ToString(), " - stat twain - ",this.Device.TwainGetState().ToString()));

                return _res;
            }
On 64 it fails and returns stat lib OK... and device (gdistance) TWAIN_PRESESSION.
Any ideas?

Thank you.

All the best.
Andrea.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: [C# 4.0 - WPF] : methods TwainSelectSource() failure.

Post by Loïc » Sun Nov 18, 2012 5:59 pm

Hello Andrea,

This is simple as is: If you run 64-bit process you need a 64-bit TWAIN driver. If you run a 32-bit process you need a 32-bit TWAIN driver.

Kind regards,

Loïc

Dr3w
Posts: 22
Joined: Fri Nov 09, 2012 6:22 pm

Re: [C# 4.0 - WPF] : methods TwainSelectSource() failure.

Post by Dr3w » Mon Nov 19, 2012 11:03 am

Hi Loïc,
thank you. I've already deployed my solution for Any CPU (64 bit & 32 bit)... and I've included both 64bit & 32bit libs (If there wasn't the 64bit lib, the application would raise an error like 'lib not found').

Anyway, I've compiled the app for 64 with ONLY 64bit lib. It doesn't work yet.
The target machine is a SO Win7, 64bit (there's a way to call the 'TWAIN source selector' via MSDOS prompt or else? Only to check if it works properly).

Thanks.
Andrea.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: [C# 4.0 - WPF] : methods TwainSelectSource() failure.

Post by Loïc » Mon Nov 19, 2012 11:14 am

Anyway, I've compiled the app for 64 with ONLY 64bit lib. It doesn't work yet.
This is because you don't have installed a 32 bit TWAIN driver. Compiling the app in 32-bit mode should resolve the issue.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests