Page 1 of 1

Detecting if a scanner is connected

Posted: Mon Apr 03, 2017 11:02 pm
by jchristian
Hi Alex,

Is there a way through the Vintasoft Twain SDK to detect if a scanner is connected or not?
Using the current devicemanager class, whether or not I have a scanner connected, it always shows a TWAIN device available.
I would like to disable some UI elements if there isn't a scanner connected, so the end user is aware of it.
So far I am not having much luck in getting this to work.

Thank You!

Re: Detecting if a scanner is connected

Posted: Thu Apr 06, 2017 4:31 pm
by Alex
Hi,

The DeviceManager class provides information about installed TWAIN drivers. Next, you need try to open the device - device is connected and ready to use if you can open the device, device is not connected or not ready for use if you cannot open the device.

Best regards, Alexander

Re: Detecting if a scanner is connected

Posted: Mon Jun 19, 2017 8:18 pm
by Echtelion
Hi,

I have a similar problem, with Canon devices reporting in .Devices collection while disconnected.

The problem is that Device.Open() show a messagebox when not connected, even with ShowUI and ShowIndicators set to false.
That's a problem when I want to enumerate devices and select the one actually connected : lots of useless messagebox.

You can easily reproduce the issue by installing this driver, even without the device.
http://www.canon.fr/support/consumer_pr ... pe=drivers

Is it something you can fix on your side ?
Thanks.

Re: Detecting if a scanner is connected

Posted: Tue Jun 20, 2017 12:56 pm
by Alex
Hi,

The DeviceManager class provides information about installed TWAIN drivers. Next, you need try to open the device - device is connected and ready to use if you can open the device, device is not connected or not ready for use if you cannot open the device.

Unfortunately, most TWAIN drivers show dialog with error message if scanner is not connected or online. Message dialog depends from TWAIN driver developer and in most cases cannot be disabled.

Best regards, Alexander