Twain Driver Hang the System

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Twain Driver Hang the System

Post by sarzan » Thu Jul 05, 2007 4:58 pm

Hi,

We are a software house evaluating you gdTwain OCX. Is well build and simple to use.

My actual problem is in releasing twain resource.

If the code flow right and all releasing method are called (like TwainCloseSource, TwainCloseSourceManager, TwainUnloadSourceManager) there are no problems at all.

But if something stop the code flow and this method are not executed twain resource stay "hanged" (twain status is between SourceManagerOpen and SourceOpen).
I find no way to release the twain resource and i have to restart the OS (windows 2000 pro in my case).

In distributed app this can't, teorically, happen... i know. But in developping this happen often and is very anoying.

You know a method or a workaround to release this resource (like terminate some kind of process or dll ) ???

Tnks in advance for reply

sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Post by sarzan » Fri Jul 06, 2007 4:50 pm

I also have another problem.

Method TwainGetSourceCount don't work.

Return an error like:
-2147417848 Automation error. Invoked object was disconnected from the corresponding client.

Any idea ??

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

Post by Loïc » Tue Jul 10, 2007 11:24 am

Hi,

Sorry for the late.

Your two problems were solved into the last release.

Please update your component and try again :wink:

Best regards,

Loïc Carrère

sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Post by sarzan » Wed Jul 11, 2007 3:55 pm

Ok, tested and is fixed, tnks !

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

Post by Loïc » Wed Jul 11, 2007 4:18 pm

You are welcome.

Thx for the return.

Loïc

sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Post by sarzan » Wed Oct 03, 2007 3:50 pm

Hi Loic,

i need some help with twain issues and i think your experience can help :)

We have bought the last release of PicturePro that include twain capabilities.

We still have some problem with Twain hanging the system and require a OS reboot (and this is a big problem for Server).

In this case i think gdPicture is not the problem. I think is a general OS problem. I try to explain:

In many case when scanning is interrupted (by user, by paper jam, by "someone disconnetting the usb cable (lol)", ecc. ecc.) the twain device remain "open". And there is no way to "reset" it or free it without reboot the system.

Probably there is a way to know i OS (windows ) have any device open and a way to kill the opened process or something like that.

You know about any API to do this ? Also a name or a hint can help....

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

Post by Loïc » Wed Oct 03, 2007 4:11 pm

Hi Sarzan,

It is a good question...

The best way to close the twain source after an acquisition process is to call the TwainCloseSource method: https://www.gdpicture.com/references/gdp ... ource.html

In server mode a tip consists to add a timer into your form which will call this methods in order to prevent from too long pause into your code.

Else, you can catch the terminate event of your application and include a call to the TwainUnloadSourceManager method inside:

https://www.gdpicture.com/references/gdp ... nager.html

I don't see other solutions. In all cases if your application has opened a source she must close it.

Best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest