GetNumericContainerValue example for Delphi
Function TForm1.TwainGetCurrentValue ( ): L_INT;
var
nRet: L_INT;
pVal: L_PUINT16;
twCap: TW_CAPABILITY;
begin
pVal:= Nil;
twCap.Cap:= ICAP_XFERMECH;
twCap.ConType:= TWON_DONTCARE16;
nRet:= LEADTwain1.GetCapability ( @twCap, LTWAIN_CAPABILITY_GETCURRENT );
if ( nRet <> SUCCESS ) then
begin
MessageBox ( Handle, 'Failed to get capability', 'ERROR', MB_OK );
Result:= FAILURE;
Exit;
end;
if ( twCap.ConType = TWON_ONEVALUE ) then
nRet:= LEADTwain1.GetNumericContainerValue ( @twCap, 0, @pVal )
else
begin
if ( twCap.ConType = TWON_ONEVALUE ) then
nRet:= LEADTwain1.GetNumericContainerValue ( @twCap, LTWAIN_VALUE_CURRENT, @pVal );
end;
Result:= nRet;
end;