LTwain::CreateNumericContainerEnum

Summary

Allocates the hContainer member of the TW_CAPABILITY structure to be type TW_ENUMERATION and fills it with the appropriate data.

Syntax

#include "ltwrappr.h"

virtual L_INT LTwain::CreateNumericContainerEnum (pCapability, Type, uNumOfItems, uCurrentIndex, uDefaultIndex, pData)

Parameters

TW_CAPABILITY * pCapability

Pointer to a structure that contains the capability container to allocate as type TW_ENUMERATION.

LTWAINNUMERICTYPE Type

Type of data contained in the TW_ENUMERATION container. For a list of possible values, refer to LTWAINNUMERICTYPE.

L_UINT32 uNumOfItems

Number of items in the enumeration.

L_UINT32 uCurrentIndex

Index of the current value in the enumeration data.

L_UINT32 uDefaultIndex

Index of the default value in the enumeration data.

L_VOID * pData

Pointer to an allocated array of type TW_ENUMERATION that has been initialized with the appropriate data and size information.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

When enumerating and getting capabilities, the toolkit takes care of creating the necessary TW_CAPABILITY containers. However, if the user wants to set a capability using the LTwain::SetCapability function, he or she must declare a TW_CAPABILITY container of the appropriate type (TW_ARRAY, TW_ENUMERATION, TW_RANGE, or TW_ONEVALUE).

Required DLLs and Libraries

See Also

Functions

Topics

Example

// initialize session and call this function 
 
L_INT LTwain__CreateNumericContainerEnumExample(LTwain *MyClass) 
 
{ 
   L_INT          nRet; 
   TW_CAPABILITY  twCap;  
   L_UINT16       uItem[3];  
 
   memset (&twCap, 0, sizeof(TW_CAPABILITY));  
 
   twCap.Cap = ICAP_XFERMECH; 
 
   twCap.ConType = TWON_ENUMERATION; 
 
   uItem[0] = TWSX_FILE; 
   uItem[1] = TWSX_MEMORY; 
   uItem[2] = TWSX_NATIVE; 
 
   nRet = MyClass->CreateNumericContainerEnum(&twCap, TWAINNUMERICTYPE_TW_UINT32, 3, TWSX_MEMORY, TWSX_NATIVE, (L_VOID *)uItem); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = MyClass->SetCapability (&twCap, LTWAIN_CAPABILITY_SET); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = MyClass->FreeContainer(&twCap); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.