EnableMethodErrors (ILEADRasterImgList) example for C++ 5 and later
TRY
{
m_LEADImageList.SetEnableMethodErrors(FALSE);
//call with invalid file name
m_LEADImageList.LoadDatabase("dd::yY");
AfxMessageBox(TEXT("no errors genererated so far"));
//enable error generation
m_LEADImageList.SetEnableMethodErrors(TRUE);
m_LEADImageList.LoadDatabase("dd::yY");
AfxMessageBox(TEXT("You should NOT get this message"));
}
CATCH_ALL(e)
{
e->ReportError();
}
END_CATCH_ALL
AfxMessageBox(TEXT("Proceeding after error was handled"));