المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Changing initial directory on File Open Dialog in MFC



C++ Programming
11-05-2010, 02:24 PM
I cannot find a way to force an OpenFileDialog under Windows 7, Visual Studio 2010 C++ to always open the a folder of my choosing. The documentation for OPENFILENAME structure states for Windows 7 "If lpstrInitialDir has the same value as was passed the first time the application used an Open or Save As dialog box, the path most recently selected by the user is used as the initial directory."

I cannot find a way to override this - I have a set directory I always want to open to no matter what.
Of course I am always setting lpstrInitialDir to that folder. That works the first time, but as it says above, next time it opens to the last folder the user selected.

I saw a few C#, .NET flags in other posts to change this, but nothing I can find for MFC/C++.

Any ideas appreciated! TIA