DTWAIN_GetDSMFullName
The DTWAIN_GetDSMFullName gets the full path name of the TWAIN Data Source Manager file that will be or is currently being used by DTWAIN to communicate to the TWAIN system.
LONG DTWAIN_GetDSMFullName (
Parameters DSMType Specifies the DSM manager, either DTWAIN_TWAINDSM_LEGACY or DTWAIN_TWAINDSM_VERSION2.
szBuffer Specifies the address of the character buffer to store the DSM path name. This parameter can also be NULL.
MaxLen Specifies the maximum number of characters to copy to szBuffer.
pWhichPath Address of a LONG that on return, will be filled in with a constant denoting which directory search found the TWAIN DSM. This parameter can also be NULL to denote no constant will be returned.
Return Values If the function succeeds, the number of characters copied to szBuffer is returned. If the function fails, DTWAIN_FAILURE1 is returned.
Character specific version
Comments The DTWAIN_GetDSMFullName function fills szBuffer with the TWAIN Data Source Manager name that will be used by DTWAIN.
The DSMType denotes the TWAIN DSM to search for. The values for DSMType are as follows:
If szBuffer is NULL, the length of the DSM file path, plus 1 for the trailing NULL, is returned. The MaxLen argument is ignored and no characters are copied to szBuffer. You can use this method to determine the total number of characters needed to store the entire name.
The pWhichSearch is a pointer to a LONG variable that on return, if not NULL, will be filled in with one of the following values:
The table above denotes how the DSM was found. The value returned denotes either
1) The system's WINDOWS directory, 2) the system's SYSTEM directory, 3) or by using the Windows OS search logic to find the DSM.
Please see Locating and Loading the TWAIN DSM for more information on the WINDOWS, SYSTEM, and OS search logic used to locate the TWAIN DSM.
Additional Notes: The DTWAIN_GetDSMFullName can be called before calling DTWAIN_SysInitialize. This function also is affected by the DTWAIN_SetDSMSearchOrder function, as DTWAIN_GetDSMFullName uses the search order specified by DTWAIN_SetDSMSearchOrder.
TWAIN State Transitions None.
Prerequisite Function Call(s) None.
|