LTwain::GetCapability

#include "ltwrappr.h"

virtual L_INT LTwain::GetCapability (pCapability, uFlags)

pTW_CAPABILITY pCapability;

/* pointer to a structure */

L_UINT uFlags;

/* optional flags */

Gets the specified capability value(s).

Parameter

Description

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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

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

Function:

LTwain::SetProperties, LTwain::GetProperties, LTwain::SetCapability, LTwain::InitSession, LTwain::EndSession.

Topics:

Getting and Setting Capabilities

 

TWAIN Functionality: Capability Functions.

Example

// initialize session and call this function 
L_INT LTwain__GetCapabilityExample(CMyTwain *MyClass)
{
   L_INT          nRet; 
   TW_CAPABILITY  twCap; 
   // Fill the TW_CAPABILITY structure with values
   twCap.Cap = ICAP_XFERMECH; 
   twCap.ConType = TWON_DONTCARE16; 
   nRet = MyClass->GetCapability(&twCap, LTWAIN_CAPABILITY_GETCURRENT); 
   if (nRet != SUCCESS) 
   {
      MessageBox (NULL, TEXT("Failed to get capability"), TEXT("ERROR"), MB_OK); 
      return nRet; 
   }
   nRet = MyClass->FreeContainer(&twCap);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}