EnableMethodErrors example for Delphi
This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle in this case):
procedure TForm1.Button3Click(Sender: TObject);
var
ShearAngle, nRet: Integer;
begin
ShearAngle := 5500; { suppose user enters 55 degrees }
Lead1.EnableMethodErrors := False;
nRet := Lead1.Shear(ShearAngle, TRUE, RGB(0,0,255));
If nRet = ERROR_INV_PARAMETER Then
ShowMessage('The angle must be within +/- 45 degrees')
Else
Lead1.ForceRepaint;
Lead1.EnableMethodErrors := True;
end;