ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Probe TWAIN device

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Xylit Posted - Apr 26 2012 : 03:14:31
Hi,

I have two twain devices installed. But Only one device is connected to the pc. Is there a way to find out which one of them?

Possibly by looping through all the twain devices, selecting each and ask for scanner information. The one, where I get the information, is connected. But what method gives me information about the scanners?
1   L A T E S T    R E P L I E S    (Newest First)
fab Posted - May 01 2012 : 10:23:25
Hi,
if your device driver supports this feature you can write, for example:
var
  i: integer;
begin
  for i:=0 to ImageEnView1.IO.TwainParams.SourceCount-1 do
  begin
    ImageEnView1.IO.TwainParams.SelectedSource := i;
    if ImageEnView1.IO.TwainParams.DeviceOnline then
      ShowMessage(Format('Device %d (%s) is online', [i, ImageEnView1.IO.TwainParams.SourceName[i]]));
  end;
end;


Unfortunately not all devices supports it. Sometime you will see a scanner dialog with errors (when ImageEn tried to communicate with the device, the driver dialog shows up). Sometime you will see erroneous results (DeviceOnline reports true when the device is offline, and viceversa).