L_TwainInitSession

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainInitSession (phSession, pAppData)

pHTWAINSESSION phSession;

/* pointer to a TWAIN session handle */

pAPPLICATIONDATA pAppData;

/* pointer to a structure */

Initializes the TWAIN session.

Parameter

Description

phSession

Pointer to a TWAIN session handle. This handle is needed to acquire pages from the TWAIN source, and work with template files, containers, capabilities, and properties.

pAppData

Pointer to an APPLICATIONDATA structure. This structure will have the handle of the parent window in addition to other data about the application.

Returns

SUCCESS

The function was successful.

! = SUCCESS

An error occurred. Refer to Return Codes.

Comments

L_TwainInitSession must be called before calling any other LEADTOOLS TWAIN toolkit functions.

When the handle to the TWAIN session is no longer needed, it should be freed by calling L_TwainEndSession. For every call to L_TwainInitSession there must be a call to L_TwainEndSession.

Note: If this function returned ERROR_TWAIN_INVALID_DLL error then this is mostly because you have an old version of TWAINDSM.DLL in your system folder, you need to make sure you have at least version 2.0.9.0 of this DLL. You can download it from www.twain.org.

Required DLLs and Libraries

LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_TwainEndSession.

Topics:

Initializing a TWAIN Session

 

TWAIN Functionality: Session Functions.

Example

For an example, refer to L_IsTwainAvailable.