LockContainer example for Delphi
Procedure TForm1.CheckConType ( ptwCap: pTW_CAPABILITY );
var
ptwOneVal: pTW_ONEVALUE;
begin
ptwOneVal:= Nil;
if ( ptwCap.ConType = TWON_ONEVALUE ) then
begin
LEADTwain1.LockContainer ( ptwCap, @ptwOneVal );
if ( ptwOneVal <> Nil ) then
begin
// Do processing
LEADTwain1.UnlockContainer ( ptwCap );
end;
end;
end;