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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 twain driver question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
497 Posts

Posted - Sep 16 2011 :  11:56:17  Show Profile  Reply
I am trying to implement thhe scanning options using twain drivers.
If i have my scanner turned off, the program still detect that a twain driver was installed and will give me an out of bound error trying to initialize that. I also tried the twain demo that gives the same result.
i have:
for i:=0 to imageenvect.io.twainparams.sourcecount -1 do
....//filling up a combobox

Is there a way i can detect if a scanner is turned on to avoid the error if not.
Thanks.
Pierre

klausdoege

Germany
389 Posts

Posted - Sep 17 2011 :  09:38:07  Show Profile  Reply
Hello,
maybe, you can first try that !
ImageEnView1.IO.SelectAcquireSource(ieaTWain);

Klaus
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Sep 20 2011 :  12:12:59  Show Profile  Reply
I found out by using if imageenvect.io.twainparams.sourcecount >0 then enable button will prevent enabling the scanning button.
Thanks for the answer.
P
PS: If your scanner is turned off and you try your command, I think you get the error.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Sep 23 2011 :  10:33:05  Show Profile  Reply
Nope, that is still not working. The issue with the twain driver is that it is always there even if the scanner is not connected. So the imageenvect.io.twainparams.sourcecount is always greater than 0. That does not happen with WIA. If the scanner is not connected, no WIA is loaded.
I need to find away to fill up my combobox with scanner name only if the scanners are turned on. I do not want to have a requester asking me to chose a scanner like with ImageEnView1.IO.SelectAcquireSource(ieaTWain);
Anyway to detect in the background if a twai scanner is turned on or off?
Thanks.
P
Go to Top of Page

fab

1310 Posts

Posted - Sep 23 2011 :  22:53:05  Show Profile  Reply
Unfortunately I don't know a way to know if a scanner is connected or not.
The twainparams.sourcecount list is read directly from the operating system (TWain device manager).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: