Examining for device availablity shows error dialogue

Issue #85 new
maximumiq created an issue

Hi,

Very nice library there, thanks. I got all of my scanning to work. But :-)

I am writing a very product specific device SDK and with this SDK, I need to be able to query for device availability. For twain devices it is somewhat difficult, because even if you remove the USB connection, the Twain device still appears as if connected.

In my case I therefore try open the DS to test for device readiness, but then I get a Twain error dialogue, that the device cannot be found, etc.. This dialogue hangs up my program at the DS open method, until I press OK.

Could this be improved somehow.

Thanks.

Comments (3)

  1. maximumiq reporter

    Maybe I should explain better how the SDK is made.

    The Twain part of my SDK has this static method,

    public static bool IsDeviceAvailable(string name);
    

    This method should ideally just return true if I call this method and the device with the given name exists and can be used. If somehow the device is not available, I should get a false. This could be called from a Factory of some sort, that could try out a number of known supported devices, and return the best suited device that would work.

    With the latest NTwain API, I cannot get this to work.

  2. Eugene Wang repo owner

    Most twain drivers do not support testing for availability. You may have seen this answer before already. Any such check is best done outside of TWAIN.

  3. maximumiq reporter

    Thanks.

    I will try solve it through USB device examination before accessing Twain devices.

  4. Log in to comment