How do I set the default dir for saving in an MFC app?
-
Howdy, I used to know how to do this, but I've completely forgotten what I used to know. Here's the problem. I have an MFC MDI application. I open it up with a new document. I use the document a while and then press select "File->Save" (or just press the disk icon). The file dialog appears, open to the current working directory. I don't want it to open to the CWD, I want the file save dialog to open to a directory that I specify. How? thanks Jim
-
Howdy, I used to know how to do this, but I've completely forgotten what I used to know. Here's the problem. I have an MFC MDI application. I open it up with a new document. I use the document a while and then press select "File->Save" (or just press the disk icon). The file dialog appears, open to the current working directory. I don't want it to open to the CWD, I want the file save dialog to open to a directory that I specify. How? thanks Jim
You can do it like this: CFileDialog dlg(...); // whatever initialization you want dlg.m_ofn.lpstrInitialDir = _T("C:\\My Folder"); dlg.DoModal(); Bret Faller Odyssey Computing, Inc.
-
You can do it like this: CFileDialog dlg(...); // whatever initialization you want dlg.m_ofn.lpstrInitialDir = _T("C:\\My Folder"); dlg.DoModal(); Bret Faller Odyssey Computing, Inc.
Thanks, but that doesn't apply here. If you make a empty MDI app you'll see that it is the MFC framework that calls the FileDialog, not the application programmer. So I need someway to tell the application framework what value I want to put into m_ofn.lpstrInitialDir before it calls the open/save file dialog. Jim