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