Original Post
i am working on the loading code for my application
and i have one problem
when you use the CFileDialog class to get the pathname of a file
char sz[256];
char szFilter[] = "Text files (*.txt)|*.txt|Bitmap Files (*.bmp)|*.bmp|Data Files (*.dat;*.dta)|*.dat; *.dta|All Files (*.*)|*.*||";
CFileDialog dlg(TRUE,_T("All files (*.*)"),_T("*.*"),OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,szFilter);
if(dlg.DoModal()==IDOK)
{
FILE *f=NULL;
f=fopen("pathname.txt","wt");
if(!feof(f))
{
CString a;
a=dlg.GetPathName();
sprintf(sz,"%s \n",a.GetBuffer(50));
fputs(sz,f);
fclose(f);
}
}
[/CODE]
and write a txt file with the path in it it saves the file to the directory where the file which i have opened with the file dialog is in
i want to save the file into the same directory as the application`s .exe
any idea how that works?