GetNumericContainerINTValue example for C++ Builder
void __fastcall TForm1::btnGetNumericContainerINTValueClick(TObject *Sender)
{
L_INT nRet;
L_INT nItemType;
L_INT nValue;
TW_CAPABILITY twCap;
// Fill the TW_CAPABILITY structure with values
twCap.Cap= CAP_XFERCOUNT;
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_INT16 )
{
nRet= LEADTwain1->GetNumericContainerINTValue ( &twCap, 0, &nValue );
if ( nRet != SUCCESS )
MessageBox ( Handle, "Failed to get capability item value", "ERROR", MB_OK );
}
}
}