GetNumericContainerUINTValue example for C++ Builder
void __fastcall TForm1::btnGetNumericContainerUINTValueClick(TObject *Sender)
{
L_INT nRet;
L_INT nItemType;
L_UINT uValue;
TW_CAPABILITY twCap;
// Fill the TW_CAPABILITY structure with values
twCap.Cap= ICAP_UNITS;
twCap.ConType= TWON_ONEVALUE;
nRet= LEADTwain1->GetCapability ( &twCap, LTWAIN_CAPABILITY_GETCURRENT );
if ( nRet != SUCCESS )
{
MessageBox ( Handle, "Failed to get capability", "ERROR", MB_OK );
return;
}
nRet= LEADTwain1->GetNumericContainerItemType ( &twCap, &nItemType );
if ( nRet != SUCCESS )
{
MessageBox ( Handle, "Failed to get capability item type", "ERROR", MB_OK );
}
else
{
if ( nItemType == TWTY_UINT16 )
{
nRet= LEADTwain1->GetNumericContainerUINTValue ( &twCap, 0, &uValue );
if ( nRet != SUCCESS )
MessageBox ( Handle, "Failed to get capability item value", "ERROR", MB_OK );
}
}
}