DTWAIN_SetTwainDSM
The DTWAIN_SetTwainDSM function selects the TWAIN Data Source Manager that will be used by the application.
DTWAIN_BOOL DTWAIN_SetTwainDSM ( LONG DSMType );
Parameters DSMType TWAIN Data Source Manager to use for subsequent TWAIN sessions.
Return Values If the function succeeds, TRUE is returned. If the function fails FALSE is returned.
Comments The DTWAIN_SetTwainDSM function allows an application to choose the TWAIN Data Source Manager to use when communicating with TWAIN devices. The TWAIN Data Source Manager (DSM) is the program that allows DTWAIN to communicate with the various TWAIN drivers installed on the system.
The DSMType argument can be one of the following values:
For 32-bit applications, the valid constants are either DTWAIN_TWAINDSM_LEGACY or DTWAIN_TWAINDSM_VERSION2. If the application being run is 64-bit, a call to DTWAIN_SetTwainDSM has no effect, since the only DSM available for 64-bit applications is DTWAIN_TWAINDSM_VERSION2.
By default, for 32-bit applications, DTWAIN will always choose TWAIN_32.DLL as the DSM, unless a call to DTWAIN_SetTwainDSM is issued to override this choice.
For most applications, there is no need to call DTWAIN_SetTwainDSM as DTWAIN will always select the DSM that is compatible with the application automatically, whether the application is a 32-bit application or 64-bit application. The DTWAIN_SetTwainDSM function is provided for developers who are developing 32-bit applications, but want to use the 32-bit open source version of the DSM (TWAINDSM.DLL for 32-bit systems).
This function should be called directly after DTWAIN_SysInitialize to ensure that DTWAIN will use the DSM set by this function instead of using the default DSM.
TWAIN State Transitions
Prerequisite Function Call(s)
See Also |