Detecting if a scanner is connected

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
jchristian
Posts: 6
Joined: Mon Oct 24, 2016 11:38 pm

Detecting if a scanner is connected

Post by jchristian » Mon Apr 03, 2017 11:02 pm

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!

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detecting if a scanner is connected

Post by Alex » Thu Apr 06, 2017 4:31 pm

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

Echtelion
Posts: 4
Joined: Mon Jun 19, 2017 8:11 pm

Re: Detecting if a scanner is connected

Post by Echtelion » Mon Jun 19, 2017 8:18 pm

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.

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detecting if a scanner is connected

Post by Alex » Tue Jun 20, 2017 12:56 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest