TRY
{
}
CATCH_ALL( e )
{
}
END_CATCH_ALL
{
}
CATCH_ALL( e )
{
}
END_CATCH_ALL
解决方案 »
- 怎么画也不能正常画出来。。。。
- 用MFC编写控件需要掌握?
- 求一个直接拖拽动态产生控件的问题
- 用vc++如何使.jpg转换成.bmp格式呢?!请高手指点 !!
- +++++++++++++++++++++dll中创建线程++++++++++++++++++++
- 如何将BOOL转成VARIANT_BOOL?
- 一个画图程序要在颜色质量分别为16,24,32位下运行,要注意什么`??
- 请问谁有HPGL文件格式的资料?
- 我有一个开放QQ群: 号码是 3157655 ,欢迎大家来讨论,共同进步
- 如何建立一个不带最大化按钮的SDI程序?
- -----------请教ActiveX中关于变量和类的问题----------------
- 我只有最后的25分,问一个对我这种初学者的绝世难题
{
// Do something to throw a file exception.
}
catch( CFileException* theException )
{
if( theException->m_cause == CFileException::fileNotFound )
TRACE( "File not found\n" );
theException->Delete();
}
{
pFile = new CFile(_T("C:\\WINDOWS\\SYSTEM.INI"),
CFile::modeRead | CFile::shareDenyNone); DWORD dwLength = pFile->GetLength(); CString str;
str.Format(_T("Your SYSTEM.INI file is %u bytes long."),
dwLength); AfxMessageBox(str);
}
CATCH(CFileException, pEx)
{
// Simply show an error message to the user. pEx->ReportError();
}
AND_CATCH(CMemoryException, pEx)
{
// We can't recover from this memory exception, so we'll
// just terminate the app without any cleanup. Normally, an
// an application should do everything it possibly can to
// clean up properly and _not_ call AfxAbort(). AfxAbort();
}
END_CATCH // If an exception occurs in the CFile constructor,
// the language will free the memory allocated by new
// and will not complete the assignment to pFile.
// Thus, our clean-up code needs to test for NULL. if (pFile != NULL)
{
pFile->Close();
delete pFile;
}