The LEADTOOLS C++ Class Library is a wrapper to the LEADTOOLS C API and provides only a subset of the features and functionality otherwise available in the LEADTOOLS C API. For more information about the full feature set of the LEADTOOLS C API, refer to LEADTOOLS C API Introduction.
Is this page helpful?
#include "ltwrappr.h"
L_INT LTwain::QueryFileSystem (FileMsg, pTwFile)
Performs certain tasks, or retrieves certain information, depending on the value of the FileMsg parameter.
Files system messages that determine the behavior of the function. For possible values, refer to the FILESYSTEMMSG.
Pointer to a TW_FILESYSTEM structure. This structure will be updated with, or will contain information used to change, the current TWAIN file system settings. This structure must be allocated.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function is only valid for TWAIN file systems for digital cameras.
If the FileMsg parameter contains one of the following flags, the pTwFile parameter must contain the proper information before calling this function. The provided information is needed to change settings within the TWAIN file system.
If the FileMsg parameter contains one of the following flags, this function will update the pTwFile parameter with the corresponding information.
If the FileMsg parameter contains the following flag, this function will use information stored within the pTwFile parameter and will update the pTwFile parameter with any appropriate information.
For more information on the TW_FILESYSTEM structure, refer to the TWAIN specification.
Required DLLs and Libraries
L_INT LTwain__QueryFileSystemExample(HWND hWnd)
{
L_INT nRet;
LTwain TwainSession;
APPLICATIONDATA AppData;
TW_FILESYSTEM twFileSys;
memset(&AppData, 0, sizeof(APPLICATIONDATA));
AppData.hWnd = hWnd;
AppData.uStructSize = sizeof(AppData);
lstrcpy (AppData.szManufacturerName, _T("LEAD Technologies, Inc."));
lstrcpy (AppData.szAppProductFamily, _T("LEAD Test Applications"));
lstrcpy (AppData.szVersionInfo, _T("Version 1.0"));
lstrcpy (AppData.szAppName, _T("TWAIN Test Application"));
nRet = TwainSession.InitSession(&AppData);
if (nRet != TWAIN_SUCCESS)
{
MessageBox(hWnd, TEXT("Error occurred during call InitSession"), TEXT("Notice"), MB_OK);
return nRet;
}
memset(&twFileSys, 0, sizeof(TW_FILESYSTEM));
nRet = TwainSession.QueryFileSystem(FILESYSTEMMSG_AUTOMATICCAPTUREDIRECTORY, &twFileSys);
if (nRet != TWAIN_SUCCESS)
{
MessageBox(hWnd, TEXT("Error occurred during call QueryFileSystem"), TEXT("Notice"), MB_OK);
return nRet;
}
nRet = TwainSession.EndSession();
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}