![]() |
|
#1
|
|||
|
|||
|
I'm using Java with JNA to access the EZTW32.dll. So far it's working great.
So I've read through the EZTwain Pro User Guide and through the forums and came up with this link on a work around for detecting if a scanner is online or not. http://www.dosadi.com/ezt3devonline.htm But the Code:
TWAIN_GetCapBool(CAP_DEVICEONLINE, 2) Is there a chance that this code could be added to the Classic version? Or can you help me understand how I might use the TWAIN_DS method? I know based on the link above why detecting a device online is a pain, but we'd really like to enable or disable a "Scan" button based on whether or not the scanner is on-line. Thank you. |
|
#2
|
||||
|
||||
|
Hi tthunt - I can probably help with that, although reading capability values is more of an EZTwain Pro thing. However, I want to make sure you understand that determining whether or not a scanner is on-line is not a *programming* problem - it's a standardization problem. CAP_DEVICEONLINE is foolishly defined by the TWAIN standard, and most TWAIN drivers implement it in a way that makes it useless.
So, you can read the value, but it doesn't solve the actual problem. The most common cases: 1. In order to read it, you have to open the device, and when you open the device, if the scanner is not on-line the driver displays an error message to the user. A. The error message cannot be suppressed (without extreme Windows hackery.) B. After reporting the error, the driver typically fails the open! As a result, by the time you can read the value of CAP_ONLINE, it is always TRUE... 2. For the Fujitsu fi-series (and some others) if the scanner is unplugged or turned off, the TWAIN driver is removed from the TWAIN device list. So when it is off-line, you can't open it to ask it if it is on-line. If you can open it and read CAP_DEVICEONLINE, then you don't need to: The value must be TRUE. There's a section about this in the EZTwain Pro User Guide, but I think it says basically the same thing. Does this clarify things some?
__________________
-spike _/\_ |
|
#3
|
|||
|
|||
|
Spike,
Thank you. That does clear it up. In our initial development, one of the developers was using a different third party software package with a Fujitsu. And he was able to determine if it was online or not. But based on your description, it sounds like it was dumb luck on our part that the Fujitsu was working the way we had hoped with the "getSources" method call we were using. Since then I've been working with EZTwain Classic and different scanners and I'm starting to gain a better understanding on how everything is working. Thank you for your response. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|