LEADTOOLS TWAIN C++ Class Library Help > Classes and Function References > LTwain > LTwain Class Members > LTwain::GetProperties |
#include "ltwrappr.h"
virtual L_INT LTwain::GetProperties (pltProperties, uStructSize, uFlags)
pLTWAINPROPERTIES pltProperties; |
/* pointer to a structure */ |
L_UINT uStructSize; |
/* size of the LTWAINPROPERTIES structure, in bytes */ |
L_UINT uFlags; |
/* optional flags */ |
Gets the current or default values of the properties defined in the LTWAINPROPERTIES structure.
Parameter |
Description |
|
pltProperties |
Pointer to a LTWAINPROPERTIES structure to be updated with the current or default properties. This must be a valid pointer for an LTWAINPROPERTIES structure. |
|
uStructSize |
Size of the LTWAINPROPERTIES structure, in bytes, for versioning. Use sizeof(LTWAINPROPERTIES). |
|
uFlags |
Flag that indicates the property values to get. Possible values are: |
|
|
Value |
Meaning |
|
LTWAIN_PROPERTIES_GETCURRENT |
[3] Get the current values. |
|
LTWAIN_PROPERTIES_GETDEFAULT |
[4] Get the default values. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function lets the user get information on the properties contained in the LTWAINPROPERTIES structure. It is a high-level alternative to getting capabilities using the LTwain::GetCapability or LTwain::EnumCapabilities functions. For more information on getting and setting TWAIN capabilities, refer to Getting and Setting Capabilities.
To set properties, use the LTwain::SetProperties function.
Required DLLs and Libraries
LTTWN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
LTwain::SetPropertyCallBack, LTwain::SetProperties, LTwain::SetCapability, LTwain::GetCapability, LTwain::InitSession, LTwain::EndSession. |
Topics: |
|
|
Example
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName L_INT CMyTwain::SetPropertyCallBack(L_UINT uCap, L_INT nStatus, L_VOID * pValue) { UNREFERENCED_PARAMETER(uCap); UNREFERENCED_PARAMETER(nStatus); UNREFERENCED_PARAMETER(pValue); // Do you error notification or any other code here. return SUCCESS; } // Function to change the transfer mode to file L_INT LTwain__GetPropertiesExample(CMyTwain *MyClass) { L_INT nRet; LTWAINPROPERTIES twProps; // Initialize to zero memset (&twProps, 0, LTWAINPROPERTIESSIZE); twProps.ImageRes.uStructSize = IMAGERESOLUTIONSIZE; twProps.DataTransfer.uStructSize = DATATRANSFERSIZE; twProps.ImageEff.uStructSize = IMAGEEFFECTSSIZE; // Get the current properties of the selected twain source nRet = MyClass->GetProperties(&twProps, LTWAINPROPERTIESSIZE,LTWAIN_PROPERTIES_GETCURRENT); if (nRet != SUCCESS) return nRet; // Change transfer mode to File twProps.DataTransfer.nTransferMode = TWSX_FILE; lstrcpy (twProps.DataTransfer.szFileName, MAKE_IMAGE_PATH(TEXT("Twain.bmp"))); twProps.DataTransfer.nScanFileFormat = TWFF_BMP; // Set the new properties MyClass->EnableCallBack (TRUE); nRet = MyClass->SetProperties(&twProps, LTWAIN_PROPERTIES_SET); if (nRet != SUCCESS) return nRet; return SUCCESS; }