Locating and Loading the TWAIN DSM File |
Top Previous Next |
When the DTWAIN_StartTwainSession function is called with a NULL second argument, DTWAIN searches the local file system for the appropriate TWAIN DSM file (either TWAIN_32.DLL or TWAINDSM.DLL).
By default, DTWAIN will search the following directories in the order below to find the DSM file:
If the TWAIN_32.DLL or TWAINDSM.DLL file is not found in either 1), 2), or 3) above, then DTWAIN will return an error whenever a function is called that requires the TWAIN DSM to be loaded in memory. This includes opening a TWAIN Data Source and various other functions.
The first directory where TWAIN_32.DLL or TWAINDSM.DLL is found in will be the version that will be loaded by DTWAIN_StartTwainSession. For example, if TWAIN_32.DLL is found in the WINDOWS directory first, then that is the version that will be used (thus not necessary to search in the SYSTEM or have the OS search for the DSM file).
If the DSM file can be found, but the DSM file is not a valid TWAIN DSM file, an error is also returned. This ensures that any other files that are named TWAIN_32.DLL or TWAINDSM.DLL that are not true DSM files will not be used.
To get the full path name of the DSM that DTWAIN will eventually use (or is currently using), you can call the DTWAIN_GetDSMFullName function.
Additional Search Order Options |