What would be the reason that this code result in an m_cause of 0 for a file open. Found plenty of reasons that another code will be returned but no reasons for 0.
CFileException fileException;
CFile myFile;
if (myFile.Open("C:\\test\\docs\\test.txt", CFile::modeCreate | CFile::modeWrite, &fileException))
{
TRACE( "Can't open file %s, error = %u\n", "test.txt", fileException.m_cause );
}
CFile::Open()returns none zero upon success, the call in your example does not fail!Check for
!CFile::Open(...)