Choosing the TWAIN Loop Model

Top  Previous  Next

Your application can choose between allowing DTWAIN to start an internal TWAIN loop when acquiring images, or allow your application to adjust the main application loop.  TWAIN requires that a message loop must be started when a Source is enabled so that the messages that TWAIN sends are processed successfully.

 

If your programming language or environment cannot adjust the main application loop, or if you want your application to use DTWAIN in the simplest way, then Modal Acquisition processing is used, and is always the default mode (therefore you never need to call explicit functions to set this mode).

 

If you have access to the main application loop (languages such as C or C++), and desire to write a more "traditional" TWAIN application where your application has complete control over the message loop processing, you should choose Modeless Acquisition Processing.  To choose Modeless processing, call DTWAIN_SetTwainMode.  If you wish to use Modeless processing, here is a simple implementation of adjusting the main application loop

 

For a complete description of TWAIN processing see Introduction to DTWAIN Acquisition Processing.