Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Is it possible to run device.acquire on a backgroudworker?

Last post 15 Dec 2007, 5:30 AM by Glenn. 3 replies.
Sort Posts: Previous Next
  •  13 Dec 2007, 11:46 AM 12876

    Is it possible to run device.acquire on a backgroudworker?

    Is it possible to run device.acquire on a backgroudworker?

    The acquiring/scanning process normally is a long-time running task, which means that if it is running on the UI thread, UI thread might not be able to update itself(repaint UI) in time. However, I tried to run device.acquire on a backgroundworker, it didn't work.

     

  •  13 Dec 2007, 6:12 PM 12879 in reply to 12876

    Re: Is it possible to run device.acquire on a backgroudworker?

    With the current release you would have to run all DotTwain code in a separate thread, including the parent window used for Twain messages (or don't provide a parent and DotTwain will create one).

    In the next version (expected the first quarter of 2008) we will have threading build-in so it will automatically run the long running portion of the scan process in a separate thread without any code change required.


    Glenn Chittenden Jr.
    Atalasoft Development Team
  •  14 Dec 2007, 9:31 AM 12882 in reply to 12879

    Re: Is it possible to run device.acquire on a backgroudworker?

    Thanks for reply.

    I am still confused about running all DotTwain code in a separate thread. What we want is to seperate DotTwain code with UI. In your answer, it seems that all DotTwain code must run with a parent window. Could we keep this parent window hidden? A backgroundworker is a background thread. I guess all DotTwain code must run in a foreground thread. Is this right?  

     

  •  15 Dec 2007, 5:30 AM 12883 in reply to 12882

    Re: Is it possible to run device.acquire on a backgroudworker?

    If you don't provide a parent, DotTwain will create a hidden window to use as the parent.  For most scanners this isn't a problem, but some drivers may require a visible window.

    I've never tried using DotTwain from a background thread, but I wouldn't think it would matter.
     


    Glenn Chittenden Jr.
    Atalasoft Development Team
View as RSS news feed in XML