Initializes the TWAIN session.
owner
The parent window handle. This cannot be NULL.
manufacturer
Optional name of the application's manufacturer.
productFamily
Optional product family name.
version
Version information.
application
Optional application name.
flags
Flag that determines the Startup method's behavior
Note that a TWAIN session is a communication session between LEADTOOLS TWAIN and your TWAIN sources. The internal TWAIN session handle that is created provides the user access to this TWAIN session. Startup or Startup2 must be called before calling any other methods that require a TWAIN session.
When the TWAIN session is no longer needed, end it by calling the Shutdown method. For each call to the Startup method there must be a call to the Shutdown method.
If you pass the UseThunkServer flag to the flags parameter, then the TWAIN session will be initialized using the THUNK server option. The only time to use the THUNK server is if you are using a TWAIN device that does not have a 64-Bit driver, and you are working on a 64-Bit operating system. In this case, this option will make it possible to detect and interact with your 32-Bit TWAIN driver/device from a 64-Bit process application.
Note: This method checks whether the currently selected TWAIN data source is TWAIN 2.x compliant. If the selected data source is TWAIN 2.x compliant, then the TWAIN 2.x data source manager (TWAINDSM.DLL) will be loaded from your system. The TWAIN version used will be TwainVersion2. If the selected data source is not TWAIN 2.x compliant, it will load the TWAIN 1.x data source manager (Twain_32.DLL) from your system. The TWAIN version used will be TwainVersion1, This checking will be done ONLY if the SetVersion method was NOT called by the user. To get the currently selected TWAIN version, call the GetVersion method.
Note: If this function throws a TwainExceptionCode::InvalidDll exception, most likely you have an old version of TWAINDSM.DLL in your system folder. Make sure you have at least version 2.0.9.0 of this DLL. Download it from www.twain.org.
Note: If this function throws a TwainExceptionCode::NotInitialized exception while the UseThunkServer flag is used, then most likely the THUNK server (ltthunkserver.exe) failed to start. In this case you need to make sure ltthunkserver.exe is registered correctly and that all dependencies listed in Using thr LEADTOOLS THUNK Utility with TWAIN topic reside in the same folder where ltthunkserver.exe is located.
For more information, refer to Initializing a TWAIN Source, Freeing the TWAIN Session and Using thr LEADTOOLS THUNK Utility with TWAIN.