Exception while opening file
- by viswanathan
Hi
I have a VC++ application and in my application i have some basic file operations.
Below is the defaulting code
CStdioFile cFile;
CFileException e;
CString sReport;
CString sHtmlfile = "testreport.html"
OutputDebugString((sHtmlfile));
if (!cFile.Open(sHtmlfile,CFile::modeCreate | CFile::modeWrite, &e ))
{
}
The problem is my application executes this piece of code every few minutes. and it works fine.
After several runs of the code the cFile.Open() function fails. I tried to get the error message
TCHAR szError[1024];
e.GetErrorMessage(szError,1024);
OutputDebugString((szError));
The irony is the szError error message is "No error occured".
This again works once i restart my application. Any idea why this occurs.
Thanks in advance.