L_TwainCreateNumericContainerArray

Summary

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

Syntax

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainCreateNumericContainerArray (pCapability, Type, uNumOfItems, pData)

Parameters

TW_CAPABILITY * pCapability

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

LTWAINNUMERICTYPE Type

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

L_UINT32 uNumOfItems

Number of items in the array.

L_VOID * pData

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

Returns

Value Meaning
SUCCESS The function was successful.
! = SUCCESS 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 L_TwainSetCapability 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

L_INT TwainCreateNumericContainerArrayExample(HTWAINSESSION g_hSession) 
{ 
   L_INT nRet; 
   TW_CAPABILITY twCap; 
   L_INT nItem[3]; 
 
   memset (&twCap, 0, sizeof(TW_CAPABILITY)); 
   twCap.Cap = ICAP_FILTER; 
   twCap.ConType = TWON_ARRAY; 
 
   nItem[0] = TWFT_RED; 
   nItem[1] = TWFT_GREEN; 
   nItem[2] = TWFT_BLUE; 
 
   nRet = L_TwainStartCapsNeg(g_hSession); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_TwainCreateNumericContainerArray(&twCap, TWAINNUMERICTYPE_TW_UINT32, 3, (L_INT *)nItem); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_TwainSetCapability(g_hSession, &twCap, LTWAIN_CAPABILITY_SET); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_TwainFreeContainer(&twCap); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_TwainEndCapsNeg(g_hSession); 
   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 API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.