CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Nov 2013

    could not save file using cfiledialog Saveas in MFC

    Hi everyone,

    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.

    CString szFilter = "XNRep Files (*.xnrep)|*.xnrep||";
    CString s = "xnrep";
    CString t = "";
    CFileDialog fileDlg(FALSE, s, t, NULL, szFilter);
    if(fileDlg.DoModal() == IDOK)
    	std::ofstream file;
    	if (file !=  NULL)
    		file << (*assembly);
    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.
    Last edited by ovidiucucu; November 12th, 2013 at 06:22 AM. Reason: added CODE tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.