Using CFileDialog to Set Current Directory
-
I just want to set the current directory to the one navigated to by the user via the CFileDialog. MFC C++ Application VS 2005 on WIndows XP. I cannot seem to find an option other than to select a specific file. I need to open multi files when the user selects the directory, but this is not using the CFileDialog. Any suggestion please. Andy.
-
I just want to set the current directory to the one navigated to by the user via the CFileDialog. MFC C++ Application VS 2005 on WIndows XP. I cannot seem to find an option other than to select a specific file. I need to open multi files when the user selects the directory, but this is not using the CFileDialog. Any suggestion please. Andy.
you can set the current directory value in registry and then pick it up from there before showing the CFileDialog. In OPENFILENAME structure set lpstrInitialDir variable. Hope this helps you.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
you can set the current directory value in registry and then pick it up from there before showing the CFileDialog. In OPENFILENAME structure set lpstrInitialDir variable. Hope this helps you.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
I wanted to use the CFileDialog to find the directory and then set it to the current directory.
Andy202 wrote:
to find the directory
which directory. the one that the user was currently in... Can you elaborate your problem?
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Andy202 wrote:
to find the directory
which directory. the one that the user was currently in... Can you elaborate your problem?
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
I just want to set the current directory to the one navigated to by the user via the CFileDialog. MFC C++ Application VS 2005 on WIndows XP. I cannot seem to find an option other than to select a specific file. I need to open multi files when the user selects the directory, but this is not using the CFileDialog. Any suggestion please. Andy.
You want to use
CFileDialog
to browse to a folder but not select a file? :confused: How about usingSHBrowseForFolder()
instead?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
You want to use
CFileDialog
to browse to a folder but not select a file? :confused: How about usingSHBrowseForFolder()
instead?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
Thanks, I used the SHBrowseForFolder. But needed to set the current directory for the CFileDialog - this was never shown - files opened in the background.
CFileDialog dlg( !save, extension, NULL, OFN\_HIDEREADONLY | OFN\_OVERWRITEPROMPT, filter ); // Set the current working directory dlg.m\_ofn.lpstrInitialDir = path;
Many thanks, Andy.
-
Thanks, I used the SHBrowseForFolder. But needed to set the current directory for the CFileDialog - this was never shown - files opened in the background.
CFileDialog dlg( !save, extension, NULL, OFN\_HIDEREADONLY | OFN\_OVERWRITEPROMPT, filter ); // Set the current working directory dlg.m\_ofn.lpstrInitialDir = path;
Many thanks, Andy.
Just use the
pidlRoot
member ofBROWSEINFO
."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch