EnableMethodErrors example for C++ 5.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).

ILEADRasterProcess *pRasterProc=NULL;
int ShearAngle = 9000; // This would be the user's inPut * 100
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
                 IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->PutEnableMethodErrors(FALSE);
int nRet = pRasterProc->Shear(m_LEADRasterView1.GetRaster(),
                              ShearAngle, TRUE, RGB(0, 0, 255));
if(nRet == ERROR_INV_PARAMETER)
{
   CString cMsg(TEXT("The angle cannot be more than 45 degrees"));
   MessageBox(cMsg, TEXT("Error"));
}
else
{
   m_LEADRasterView1.ForceRepaint();
}
pRasterProc->Release();