r***@gmail.com
16 years ago
I keep getting errno 2 (path does not exist) errors when attempting to
fopen filenames obtained from FileDlg in MFC.
If I copy the path (which I direct into the debugger) and through it
into Explorer it finds the file with no trouble.
Permissions are fine. Located locally. Could someone please help? I
already wasted 2 hrs into this.
*snip*
CString file_name = FileDlg.GetPathName();
FILE * pFile;
const char * name = (const char *)file_name.GetString();
output.Format(_T("trying to open this file: %s\n"),name);
OutputDebugString(output);
pFile = fopen ( name , "rb");
if (!pFile)
{output.Format(_T("Error reading file! Error code: %i. \n(Google
'errno %i' to see what it means)\n"),errno, errno);
AfxMessageBox(output);}
fopen filenames obtained from FileDlg in MFC.
If I copy the path (which I direct into the debugger) and through it
into Explorer it finds the file with no trouble.
Permissions are fine. Located locally. Could someone please help? I
already wasted 2 hrs into this.
*snip*
CString file_name = FileDlg.GetPathName();
FILE * pFile;
const char * name = (const char *)file_name.GetString();
output.Format(_T("trying to open this file: %s\n"),name);
OutputDebugString(output);
pFile = fopen ( name , "rb");
if (!pFile)
{output.Format(_T("Error reading file! Error code: %i. \n(Google
'errno %i' to see what it means)\n"),errno, errno);
AfxMessageBox(output);}
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]