Riddle me this... I have a file thats name has 2 spaces in a row (eg "filename with whitespace". It wont open using the code below. I can access the file from explorer on the machine im testing but cant do it using this code, OR get any meaningful errors back from the exception.
CFileException cFileEx;
if ( !m_fileIn.Open(sFilename,CFile::modeRead,&cFileEx) )
{
TCHAR sErr[255];
BOOL bGotErr = cFileEx.GetErrorMessage(sErr,255);
cerr << "Failed to open \"" << sFilename << "\"" << sErr << endl;
return FALSE;
}
I would like to know why CFile::Open returns FALSE but does not do anything with cFileEx (sErr is empty) ????
CFileException cFileEx;
if ( !m_fileIn.Open(sFilename,CFile::modeRead,&cFileEx) )
{
TCHAR sErr[255];
BOOL bGotErr = cFileEx.GetErrorMessage(sErr,255);
cerr << "Failed to open \"" << sFilename << "\"" << sErr << endl;
return FALSE;
}
I would like to know why CFile::Open returns FALSE but does not do anything with cFileEx (sErr is empty) ????