EnableMethodErrors example for C++ Builder
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):
void __fastcall TForm1::Button3Click(TObject *Sender)
{
int ShearAngle, nRet;
ShearAngle = 5500; /* suppose user enters 55 degrees */
Lead1->EnableMethodErrors = False;
nRet = Lead1->Shear(ShearAngle, TRUE, RGB(0,0,255));
if(nRet == ERROR_INV_PARAMETER)
ShowMessage("The angle must be within +/- 45 degrees");
else
Lead1->ForceRepaint();
Lead1->EnableMethodErrors = True;
}