|
-
October 19th, 1999, 06:48 AM
#1
How to read the file
Hi,
I have an ini file and i would like to read it but
it keeps sending the message Access to an unamed file was denied.
Here is my code.
Can you check it please ?
thanks
Olivier
//////////////////////////////////////////////////////////////////
//Open the Ini file and read it
CString CMyAppApp::GetPathToReport(CString szPathToIni)
{
CString szPathToReport = "";
TRY
{
CFile file(szPathToIni, CFile::modeNoTruncate | CFile::modeCreate | CFile::modeWrite);
DWORD dwLength = file.GetLength();
LONG lOffset = dwLength, lActual;
lActual = file.Seek(lOffset, CFile::begin);
file.Read(&szPathToReport, (UINT) dwLength);
return(szPathToReport);
file.Close();
}
CATCH_ALL(err)
{
err->ReportError();
}
END_CATCH_ALL
return(szPathToReport);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|