TWAIN sample hangs when scanning two pages

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
DevExec
Posts: 4
Joined: Mon Jan 26, 2009 11:01 am

TWAIN sample hangs when scanning two pages

Post by DevExec » Wed May 20, 2009 11:49 am

Using twain sample CS that comes with the product, I attempted to try scanning two pages (without duplex mode), from the Panasonic KV-S1025C.

When I click Demo1 or Demo2, scanning a single page, there is no problem. If there is no paper, it shows an error as expected.

First problem is that the main application disappears (it appears to have been moved to back of all other applications).

Q: Why does it loose focus? Can I stop this from happening?

When I click Demo3 or Demo4 or Demo5, scanning multiple pages, then the first two pages run through correctly and the application hangs up. The call to TwainAcquireToGdPictureImage never returns.

ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(this.Handle);

Q: How can I prevent this from happening? Why does it happen?

Q: Is there an event raised during scanning for determining progress?

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

Re: TWAIN sample hangs when scanning two pages

Post by Loïc » Wed May 20, 2009 11:56 am

Hi,

Please give us a log & check some things described here: viewtopic.php?t=1486

Kind regards,

Loïc

DevExec
Posts: 4
Joined: Mon Jan 26, 2009 11:01 am

Re: TWAIN sample hangs when scanning two pages

Post by DevExec » Wed May 20, 2009 10:24 pm

Having downloaded the latest version from your web-site and uninstalled and reinstalled the application and samples, I recompiled and ran again. This time, whilst the main form still gets moved to the back of the display order, the scanning processes completed successfully. Either you've fixed the problem in your code, or perhaps the action of uninstall and reinstall solved the problem. This may relate to the fact that I originally installed your component a few weeks ago and recently installed the scanner driver.

As for the problem of the main form jumping to the back of the display order, I suspect that the problem is with the hiding of the UI for the scanner driver. I think it appears and then disappears a moment later and the focus is given to the next application in the windows order, rather than back to the sample application.

To solve this, I changed all references of this.Handle to IntPtr.Zero and the problem went away.

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

Re: TWAIN sample hangs when scanning two pages

Post by Loïc » Thu May 21, 2009 8:45 pm

Hi,

Thank you for the feedback.

For the window displayed in bottom, it is a known issue which should be resolved into the next release.

Kind regards,

Loïc

dbrudno
Posts: 2
Joined: Fri Oct 15, 2010 12:56 am

Re: TWAIN sample hangs when scanning two pages

Post by dbrudno » Fri Oct 15, 2010 1:16 am

I have an evaluation version of gdpicture.net version 7 and I have the same problem. The main application window disappears when scanning more than one page. If I set handle to 0 then the problem goes away. My only problem with this is that the documentation says setting handle to 0 would be a problem with Citrix and I have no way of knowing for sure if we would ever have a client using citrix.

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

Re: TWAIN sample hangs when scanning two pages

Post by Loïc » Fri Oct 15, 2010 1:33 pm

Hi,
The main application window disappears when scanning more than one page
Do you mean the windows is destroyed or simply lost the focus ?
Also, in Citrix you can use 0 for the window handle. The document just states that if a windows is used it must be a top-level window or a child of a top level window.

Kind regards,

Loïc

dbrudno
Posts: 2
Joined: Fri Oct 15, 2010 12:56 am

Re: TWAIN sample hangs when scanning two pages

Post by dbrudno » Sun Oct 17, 2010 6:31 pm

The window loses focus. It is still on the taskbar but not in the alt-tab. If using 0 for handle is not a problem then I can just go that route.

Thank you,

dbrudno.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest