Programming/Visual Studio CFile 처리하기 - MFC에서 파일 열기 예외 처리할 때 오류 메시지 m_cause 에 따라 일일이 찍기 귀찮아서 GetErrorMessage() 함수 이용하는 예제를 기록용으로 남깁니다. 코드 참고, m_cause 값 참고 CFile file; CFileException fileErr; CString strFileName(_T("C:\test.txt")); if (!file.Open(strFileName, CFile::modeRead, &fileErr) { CString strMsg; TCHAR szMsg[256]; fileErr.GetErrorMessage(szMsg, sizeof(szMsg)); strMsg.Format(_T("error on file %s : %s(code:%d)"), strFileName, szMsg, fileErr.m_cause); AfxMessageBox(strMsg); fileErr.ReportError(); return -1; } 공유하기 게시글 관리 구독하기sr's lair 저작자표시 'Programming > Visual Studio' 카테고리의 다른 글 MAC 주소 얻기 (0) 2019.07.02 [VS2017] LNK1104: mfc90.lib 파일을 열 수 없습니다 (2) 2019.06.21 [VS2008] 코드 정의창 배경 바꾸기 (0) 2016.10.20 [VS2008] 코드 정의 창 배경색 바꾸기 (0) 2016.06.15 [Winmerge] Visual Studio 용 무시할 파일 추가하기 (0) 2016.01.26 Contents 당신이 좋아할만한 콘텐츠 MAC 주소 얻기 2019.07.02 [VS2017] LNK1104: mfc90.lib 파일을 열 수 없습니다 2019.06.21 [VS2008] 코드 정의창 배경 바꾸기 2016.10.20 [VS2008] 코드 정의 창 배경색 바꾸기 2016.06.15 댓글 0 + 이전 댓글 더보기