GetNumericContainerSTRINGValue example for Delphi
procedure TForm1.btnGetNumericContainerSTRINGValueClick(Sender: TObject);
var
nRet: L_INT;
nItemType: L_INT;
twString: TW_STR1024;
twCap: TW_CAPABILITY;
begin
// 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 ) then
begin
MessageBox ( Handle, 'Failed to get capability', 'ERROR', MB_OK );
Exit;
end;
nRet:= LEADTwain1.GetNumericContainerItemType ( @twCap, @nItemType );
if ( nRet <> SUCCESS ) then
begin
MessageBox ( Handle, 'Failed to get capability item type', 'ERROR', MB_OK );
end
else
begin
if ( nItemType = TWTY_STR32 ) then
begin
nRet:= LEADTwain1.GetNumericContainerSTRINGValue ( @twCap, 0, twString );
if ( nRet <> SUCCESS ) then
MessageBox ( Handle, 'Failed to get capability item value', 'ERROR', MB_OK );
end;
end;
end;