CFileException m_cause == 11

首先贴上MSDN上的解释:

  • CFileException::none   No error occurred.

  • CFileException::genericException   An unspecified error occurred.

  • CFileException::fileNotFound   The file could not be located.

  • CFileException::badPath   All or part of the path is invalid.

  • CFileException::tooManyOpenFiles   The permitted number of open files was exceeded.

  • CFileException::accessDenied   The file could not be accessed.

  • CFileException::invalidFile   There was an attempt to use an invalid file handle.

  • CFileException::removeCurrentDir   The current working directory cannot be removed.

  • CFileException::directoryFull   There are no more directory entries.

  • CFileException::badSeek   There was an error trying to set the file pointer.

  • CFileException::hardIO   There was a hardware error.

  • CFileException::sharingViolation   SHARE.EXE was not loaded, or a shared region was locked.

  • CFileException::lockViolation   There was an attempt to lock a region that was already locked.

  • CFileException::diskFull   The disk is full.

  • CFileException::endOfFile   The end of file was reached.


第11个是:CFileException::hardIO   There was a hardware error.  没错 就是这个。


然后看到有个网友推测原因:

hz129(古雨)

是不是你生成文件的句柄还没释放,所以该文件被锁为只读或根本不能读写了?
我也没遇到过,只是我的猜想

果断正确,我有两个项目,一个项目调试中,输出文件; 启动另一个项目读取文件····· 就这么回事儿,退出前一个项目即可顺利读取,Close();


是不是你生成文件的句柄还没释放,所以该文件被锁为只读或根本不能读写了?
我也没遇到过,只是我的猜想
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值