CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 1999
    Location
    Ieper, Belgium, Europe
    Posts
    9

    CFileDialog: I want to select only a path, not a filename

    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



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: CFileDialog: I want to select only a path, not a filename

    if you want to allow the user to select a folder, use the ShBrowseForfolder API


  3. #3
    Join Date
    Jun 1999
    Posts
    158

    Re: CFileDialog: I want to select only a path, not a filename

    If you are using CFileDialog and DoModal you can use GetPathName(); instead of GetFileName();

    Hope this helps

    Louise


  4. #4
    Join Date
    May 1999
    Location
    Yerevan, Armenia
    Posts
    147

    Re: CFileDialog: I want to select only a path, not a filename

    I hope that using of OFN_NOVALIDATE flag in CFileDialog constructor will solve your problem

    Zorik



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured