EnableMethodErrors example for C++ 4.0 and later

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).

int ShearAngle = 9000; // This would be the user's input * 100
m_Lead1.SetEnableMethodErrors(FALSE);
int nRet = m_Lead1.Shear(ShearAngle, TRUE, RGB(0, 0, 255));
if (nRet == 20013)
{
   CString cMsg("The angle cannot be more than 45 degrees");
   MessageBox(cMsg, "Error");
}
else
{
   m_Lead1.ForceRepaint();
}
m_Lead1.SetEnableMethodErrors(TRUE);