Initializing a TWAIN Session
Before initializing a TWAIN session, the user should set the values of the following optional, application specific properties:
To begin using the LEADTOOLS TWAIN toolkit, the user must initialize a TWAIN session. This is done by calling the InitSession method after creating the LEADRasterTwain object using the CoCreateInstance function. Each call to the InitSession method will create an internal TWAIN session handle, which is a communication handle between LEADTOOLS TWAIN and a TWAIN driver installed on the system. The InitSession method must be called before calling other LEADTOOLS TWAIN properties, methods or events.
If the user sets the InitSessionFlags property to L_LTWAIN_INIT_MULTI_THREADED before calling InitSession method, then the Twain session will be initialized with multi-threaded option.
To make the toolkit generate system error events, in addition to error return codes, set the EnableMethodErrors property to TRUE.
After initializing the TWAIN session, 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.