Click to See Complete Forum and Search --> : CFileDialog: I want to select only a path, not a filename


Pegasus
October 21st, 1999, 07:09 AM
Hey Folks

I am currently developping an application where i need to store a file in a certain directory.
The filename is determined by the application, but the path isn't.
If I use a filedialog, i need to select a file, before i can click ok.
Is it possible to only take the path of the directory without selecting a filename?

I really hope someone can help me solve my problem asap.

Thanks in Advance

Lothar Haensler
October 21st, 1999, 07:15 AM
if you want to allow the user to select a folder, use the ShBrowseForfolder API

LouLou
October 21st, 1999, 07:21 AM
If you are using CFileDialog and DoModal you can use GetPathName(); instead of GetFileName();

Hope this helps

Louise

Zorik Galstyan
October 21st, 1999, 07:21 AM
I hope that using of OFN_NOVALIDATE flag in CFileDialog constructor will solve your problem

Zorik