changing initial search directory
Hello. I have a button that upon pushing it, it opens a dialog box so a user can open a file. How can I specify in the code where I want the initial directory to start from? The files that go with the application are always in the same directory and I want to be able to specify this directory when the user first clicks on the button to open the file dialog box. THanks.
Re: changing initial search directory
Hi,
I suppose you are using CFileDialog class to do this, so:
CFileDialog MyOpenFileDialog (//parameters for constructor...//);
LPCTSTR MyPath = "c:\\MyFolder\\";
MyOpenFileDialog.m_ofn.lpstrInitialDir = MyPath;
MyOpenFileDialog.DoModal();
Hope it wil be useful.
Kepa Metola
Re: changing initial search directory
Try SetCurrentDirectory(...)