I have an old project in Visual C++ and I'm trying to migrate it to Visual Studio 2013. When I verify if a txt file exists, CFile
returns debug assertion error. The code is:
if (!txt_file.Open(txt_name, CFile::modeWrite | CFile::shareDenyWrite | CFile::typeText))
{
//action if the file exists
}
What is the problem, I'm doing something wrong ? Thank you
L.E. :
txt_file
is declared as : CStdioFile txt_file
in the class trace
txt_name
is declared as : private CString txt_name
in the method named open_file
from class trace
The method open_file
contains the if statement that returns debug assertion error.