GetNumericContainerBOOLValue example for Delphi
procedure TForm1.btnGetNumericContainerBOOLValueClick(Sender: TObject);
var
nRet: L_INT;
nItemType: L_INT;
bValue: L_BOOL;
twCap: TW_CAPABILITY;
begin
// Fill the TW_CAPABILITY structure with values
twCap.Cap:= CAP_AUTOFEED;
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_BOOL ) then
begin
nRet:= LEADTwain1.GetNumericContainerBOOLValue ( @twCap, 0, @bValue );
if ( nRet <> SUCCESS ) then
MessageBox ( Handle, 'Failed to get capability item value', 'ERROR', MB_OK );
end;
end;
end;