Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS TWAIN C DLL Help

L_TwainGetNumericContainerBOOLValue

Show in webframe

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainGetNumericContainerBOOLValue(pCapability, nIndex, pbValue)

TW_CAPABILITY * pCapability;

/* pointer to a structure */

L_INT nIndex;

/* values index */

L_BOOL *pbValue;

/* pointer to a Boolean value */

Gets the specified value from a container.

Parameter

Description

pCapability

Pointer to a TW_CAPABILITY structure that references the container value to get.

nIndex

Index of the value to get. Possible values are:

 

Value

Meaning

 

LTWAIN_VALUE_COUNT

[-1] Update ppValue with the number of items in the item list of the specified container. This option is only valid if the container is of type TW_ARRAY or TW_ENUMERATION. If the container is of any other type, this function will return an error code.

 

LTWAIN_VALUE_CURRENT

[-2] Update ppValue with the current value of the container. If the container is of type TW_RANGE, ppValue is updated with the CurrentValue member of the TW_RANGE structure. If the container is of type TW_ENUMERATION, ppValue is updated with the CurrentIndex member of the TW_ENUMERATION structure. If the container is of any other type, the function will return an error code.

 

LTWAIN_VALUE_DEFAULT

[-3] Update ppValue with the default value of the container. If the container is of type TW_RANGE, ppValue is updated with the DefaultValue member of the TW_RANGE structure. If the container is of type TW_ENUMERATION, ppValue is updated with the DefaultIndex member of the TW_ENUMERATION structure. If the container is of any other type, the function will return an error code.

 

LTWAIN_VALUE_MINIMUM

[-4] Update ppValue with the minimum value of the container. If the container is of type TW_RANGE, ppValue is updated with the MinValue member of the TW_RANGE structure. If the container is of any other type, the function will return an error code.

 

LTWAIN_VALUE_MAXIMUM

[-5] Update ppValue with the maximum value of the container. If the container is of type TW_RANGE, ppValue is updated with the MaxValue member of the TW_RANGE structure. If the container is of any other type, the function will return an error code.

 

LTWAIN_VALUE_STEPSIZE

[-6] Update ppValue with the step size of the container. If the container is of type TW_RANGE, ppValue is updated with the StepSize membr of the TW_RANGE structure. If the container is of any other type, the function will return an error code.

 

>= 0

Update ppValue with the value at the specified index. If the container is of type TW_ONEVALUE, nIndex must be zero and ppValue will be updated with the value of the TW_ONEVALUE structure. If the container is of type TW_ARRAY or TW_ENUMERATION, ppValue will be updated with the value at the specified index in the list of items. If the container is of type TW_ENUMERATION or TW_ARRAY, the value must not exceed the number of items in the container's item list or the function will return an error code.

pbValue

Reference to a Boolean value to be updated with the specified container value.

Returns

SUCCESS

The function was successful.

! = SUCCESS

An error occurred. Refer to Return Codes.

Comments

Use this function to get a value from a container's item list when the item list type is Boolean.

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:

L_TwainGetNumericContainerItemType, L_TwainGetNumericContainerINTValue, L_TwainGetNumericContainerUINTValue, L_TwainGetNumericContainerFIX32Value, L_TwainGetNumericContainerFRAMEValue, L_TwainGetNumericContainerSTRINGValue, L_TwainGetNumericContainerUNICODEValue.

Topics:

How to Work with the Containers

 

TWAIN Functionality: Container Functions.

Example

 L_INT TwainGetNumericContainerBOOLValueExample(L_INT nItemType,HTWAINSESSION g_hSession)
{
   L_INT nRet;
   TW_CAPABILITY twCap;
   L_BOOL bValue;

   // Fill the TW_CAPABILITY structure with values
   twCap.Cap = CAP_AUTOFEED;
   twCap.ConType = TWON_ONEVALUE;
   nRet = L_TwainGetCapability(g_hSession, &twCap, LTWAIN_CAPABILITY_GETCURRENT);
   if (nRet != SUCCESS)
   {
      MessageBox (NULL, TEXT("Failed to get capability"), TEXT("ERROR"), MB_OK);
      return nRet;
   }

   nRet = L_TwainGetNumericContainerItemType(&twCap, &nItemType);
   if (nRet != SUCCESS)
   {
      MessageBox (NULL, TEXT("Failed to get capability item type"), TEXT("ERROR"), MB_OK);
      return nRet;
   }
   else if (nItemType == TWTY_BOOL)
   {
      nRet = L_TwainGetNumericContainerBOOLValue (&twCap, 0, &bValue);
      if (nRet != SUCCESS)
      {
         MessageBox (NULL, TEXT("Failed to get capability item value"), TEXT("ERROR"), MB_OK);
         return nRet;
      }
   }

   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.