DTWAIN_IsTwainAvailable |
Top Previous Next |
The DTWAIN_IsTwainAvailable function determines whether TWAIN is installed
DTWAIN_BOOL DTWAIN_IsTwainAvailable( );
Parameters None.
Return Values The return value is TRUE if TWAIN is installed. Otherwise FALSE is returned.
Comments The DTWAIN_IsTwainAvailable function should be called before attempting to call any other DTWAIN_SysInitialize function. Even though DTWAIN checks for TWAIN availability for most of the DTWAIN functions, by letting the application determine whether TWAIN is installed will allow the application to bypass any DTWAIN specific code, enable / disable TWAIN related options, etc.
The DTWAIN_IsTwainAvailable function will check to see if the Twain Data Source Manager, TWAIN_32.DLL or TWAINDSM.DLL, is available on the system using the search order set by DTWAIN_SetDSMSearchOrder and if found, a second test is made to see whether it is a legitimate Twain Data Source Manager (i.e. the DLL is not corrupted, and it contains the correct exported functions to qualify as a Twain Data Source Manager).
If the application being developed is 64-bit, DTWAIN_IsTwainAvailable will only look for the 64-bit version of TWAINDSM.DLL in an available path.
The DTWAIN_IsTwainAvailable function can be called before calling DTWAIN_SysInitialize.
Please note: If the DTWAIN_SetDSMSearchOrder function is called prior to calling DTWAIN_IsTwainAvailable, the search order set by DTWAIN_SetDSMSearchOrder is used to determine TWAIN availability. Otherwise, if DTWAIN_SetDSMSearchOrder is not called, the search criteria used by DTWAIN_IsTwainAvailable to find the Data Source Manager is as follows: 1) WINDOWS directory, 2) SYSTEM directory, and finally 3) a Windows OS search using the search logic that Windows uses to locate DLL files
(see Locating and Loading the TWAIN DSM for more information on search order and DSM files).
TWAIN State Transitions None
Prerequisite Calls None.
Optional Prerequisite Calls None.
See Also |