CFileException::m_cause

包含 CFileException 列舉型別所定義的值。

int m_cause;

備註

此資料成員是型別 int的公用變數。列舉值及其意義如下:

  • CFileException::none 沒有錯誤發生。

  • CFileException::genericException 發生未指定的錯誤。

  • 找不到CFileException::fileNotFound 檔案。

  • 路徑的CFileException::badPath 全部或部分無效。

  • CFileException::tooManyOpenFiles 開啟檔案的允許數目已經超過。

  • CFileException::accessDenied 檔案無法存取。

  • 其中CFileException::invalidFile 是嘗試使用無效的檔案控制代碼。

  • 無法移除CFileException::removeCurrentDir 目前工作目錄。

  • 其中CFileException::directoryFull 沒有其他目錄項目。

  • 其中CFileException::badSeek 是嘗試的錯誤設定檔案指標。

  • 其中CFileException::hardIO 是硬體錯誤。

  • CFileException::sharingViolation SHARE.EXE 未載入,或是共用區域鎖定。

  • 其中CFileException::lockViolation 是嘗試鎖定已鎖定的區域。

  • CFileException::diskFull 磁碟已滿。

  • CFileException::endOfFile 檔案結尾已經到達。

    注意事項注意事項

    這些 CFileException 原因列舉值從 CArchiveException 原因列舉值是不同的。

    注意事項注意事項

    CArchiveException::generic 已被取代。使用 genericException 。如果 generic 應用程式並且以/clr 建置,都不能用於解密的語法錯誤。

範例

try
{
   CFile f(_T("M_Cause_File.dat"), CFile::modeWrite);
}
catch(CFileException* e)
{
   if( e->m_cause == CFileException::fileNotFound)
      TRACE(_T("ERROR: File not found\n"));
   e->Delete();
}

需求

Header: afx.h

請參閱

參考

CFileException 類別

階層架構圖