Initializing a TWAIN Session

To begin using the LEADTOOLS TWAIN toolkit, the user must initialize a Twain session handle. This is done by calling either the L_TwainInitSession function. L_TwainInitSession initializes the session without multi-threading.  Each call to this  function will create a session handle of type HTWAINSESSION. This handle is passed to many of the LEADTOOLS TWAIN API functions, so this function must be called before calling other LEADTOOLS TWAIN functions.

To begin using the LEADTOOLS TWAIN toolkit, the user must initialize a Twain session handle. This is done by calling the L_TwainInitSession or L_TwainInitSession2 functions. Each call to one of both functions will create a session handle of type HTWAINSESSION. The L_TwainInitSession2 function will give you more functionality to initialize a Twain handle by passing initialize flags to uFlags parameter. This handle is passed to many of the LEADTOOLS TWAIN API functions, so this function must be called before calling other LEADTOOLS TWAIN functions.

After establishing the TWAIN session handle, the user can now select the TWAIN source he or she wants to use for acquiring images. For more information on this, refer to Managing the TWAIN Source.