November 5th, 2013, 04:02 PM
could not save file using cfiledialog Saveas in MFC
I am trying to develop a GUI using MFC, but I am having trouble using CFiledialog to save a file. The problem is, the file is not getting saved to the folder when I use the CFiledialog. Below is the code I am using.
After the file dialog opens up, I enter the name of the file and select OK button. But the file does not show up in the directory I am saving to. Any suggestions would be appreciated. Thanks.
CString szFilter = "XNRep Files (*.xnrep)|*.xnrep||";
CString s = "xnrep";
CString t = "";
CFileDialog fileDlg(FALSE, s, t, NULL, szFilter);
if(fileDlg.DoModal() == IDOK)
if (file != NULL)
file << (*assembly);
Last edited by ovidiucucu; November 12th, 2013 at 07:22 AM.
Reason: added CODE tags
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!