I'm trying to open a CFile using this code:
Code:
...
CFile file;
CFileException fileex;
TCHAR cause[1024];
BOOL result=file.Open(dlg->GetPathName(),
CFile::modeCreate || CFile::modeNoTruncate ||
CFile::modeWrite, &fileex);
if (result==0)
{
fileex.GetErrorMessage(cause,1024);
CString errorText;
errorText.Format("Could not open file\n %s",cause);
::MessageBox(0,errorText,"ERROR",MB_ICONEXCLAMATION);
return;
}
...
I get an internal compiler error number C1001. All optimizations are turned off for the debug version. This is happening in MSVC 6.
Either way the file is not being opened because it says it cannot find it. However if you notice I use CFile::modeCreate which should create the file regardless if it exists or not.