GetNumericContainerINTValue example for Delphi
procedure TForm1.btnGetNumericContainerINTValueClick(Sender: TObject);
var
nRet: L_INT;
nItemType: L_INT;
nValue: L_INT;
twCap: TW_CAPABILITY;
begin
// 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 ) 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_INT16 ) then
begin
nRet:= LEADTwain1.GetNumericContainerINTValue ( @twCap, 0, @nValue );
if ( nRet <> SUCCESS ) then
MessageBox ( Handle, 'Failed to get capability item value', 'ERROR', MB_OK );
end;
end;
end;