CFile::Open
virtual BOOL Open( LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL );
不抛出异常 用参数返回CFile( LPCTSTR lpszFileName, UINT nOpenFlags );
throw( CFileException );
-----------------------
抛出异常所以会有你上面个情况
virtual BOOL Open( LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL );
不抛出异常 用参数返回CFile( LPCTSTR lpszFileName, UINT nOpenFlags );
throw( CFileException );
-----------------------
抛出异常所以会有你上面个情况
DWORD nFileLength = myTiffFile.GetLength();
抛出的异常为什么捕获不到,因为这儿(第一种情况)确实抛出了异常
第二种情况CFile myNoThisFile("F:\\NoThisFile.xxx",CFile::modeRead);
就抛出异常 根本就不会执行到DWORD nFileLength = myTiffFile.GetLength();
第一次抛出异常时(CFile::GetLength()),但为什么捕获不到?