Link to home
Start Free TrialLog in
Avatar of ealva
ealva

asked on

Asynchronous Functions

My current project involves implementing imaging functionality inside a .dll.  I have used TWAIN for the imaging and gotten pretty used to it.  However, the project also requires that functions be done asynchronously (ie. done in the background).  TWAIN requires a message hook but since this is a dll module, the program 'steals' the app's message queue blocking all messages until the scan is finished.

Are there any other possible approaches here?  (Others suggested that I create a separate .exe that is launched by the .dll, but I think that is way too complicated, for me, at least).
Avatar of Belgarat
Belgarat

Can you run the scanning process in a separate thread ? In Win32 each thread has its own message queue, so the rest of your app should remain responsive to the user and TWAIN will block only that one queue.
Look for "CWinThread" and "Multithreading: Creating Worker Threads" on the help.
ASKER CERTIFIED SOLUTION
Avatar of Priyesh
Priyesh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ealva

ASKER

Thank U.