#include "lttwn.h"
L_LTTWN_API L_INT L_TwainGetCapability (hSession, pCapability, uFlags)
HTWAINSESSION hSession; |
handle to an existing TWAIN session |
pTW_CAPABILITY pCapability; |
pointer to a structure |
L_UINT uFlags; |
optional flags |
Gets the specified capability value(s).
| Parameter | Description | |
| hSession | Handle to an existing TWAIN session. This handle is obtained by calling the L_TwainInitSession or L_TwainInitSession2 function. | |
| pCapability | Pointer to a TW_CAPABILITY structure that references the required capability. This structure must be allocated and it will be filled with data corresponding to the required capability to get. | |
| uFlags | Flags that indicate the capability values to get. Possible values are: | |
| Value | Meaning | |
| LTWAIN_CAPABILITY_GETCURRENT | [3] Get the current value. | |
| LTWAIN_CAPABILITY_GETDEFAULT | [4] Get the default value. | |
| LTWAIN_CAPABILITY_GETVALUES | [5] Get all available values. | |
SUCCESS |
The function was successful. |
! = SUCCESS |
An error occurred. Refer to Return Codes. |
This function must be called after L_TwainStartCapsNeg is called and before L_TwainEndCapsNeg is called.
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. |
Function: |
L_TwainStartCapsNeg, L_TwainEndCapsNeg, L_TwainSetProperties, L_TwainGetProperties, L_TwainSetCapability, L_TwainInitSession, L_TwainEndSession. |
Topics: |
|
|
L_INT TwainGetCapabilityExample(HTWAINSESSION hSession){L_INT nRet;TW_CAPABILITY twCap;nRet = L_TwainStartCapsNeg (hSession);if(nRet != SUCCESS)return nRet;// Fill the TW_CAPABILITY structure with valuestwCap.Cap = ICAP_XFERMECH;twCap.ConType = TWON_DONTCARE16;nRet = L_TwainGetCapability (hSession, &twCap, LTWAIN_CAPABILITY_GETCURRENT);if (nRet != SUCCESS){MessageBox (NULL, TEXT("Failed to get capability"), TEXT("ERROR"), MB_OK);return nRet;}nRet = L_TwainFreeContainer(&twCap);if(nRet != SUCCESS)return nRet;nRet = L_TwainEndCapsNeg(hSession);if(nRet != SUCCESS)return nRet;return SUCCESS;}