我在 Visual C++ 中有一个旧项目,我正在尝试将其迁移到 Visual Studio 2013。当我验证 txt 文件是否存在时,CFile
返回调试断言错误。代码是:
if (!txt_file.Open(txt_name, CFile::modeWrite | CFile::shareDenyWrite | CFile::typeText))
{
//action if the file exists
}
有什么问题,我做错了什么?谢谢
乐:
txt_file
CStdioFile txt_file
在类trace
txt_name
中声明为:在类private CString txt_name
中命名的方法中声明为:
该方法包含返回调试断言错误的 if 语句。open_file
trace
open_file