CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    Suggesting a name in the File Dialog

    Hi
    I was wondering if somebody could tell me how to "suggest" a name to the File Dialog each time it opens up. What I mean by "suggest" is when the File Dialog Box opens up there is already a name there for the user to save as, if he or she wants to use.
    Thanks


  2. #2
    Join Date
    Sep 1999
    Location
    Virginia
    Posts
    5

    Re: Suggesting a name in the File Dialog

    If your filedialog box uses an edit window to input the file name, you could use
    ((CEdit*)GetDlgItem(IDC_EDIT1))->SetWindowText(filename); //Set filepath test to Edit 1 edit box
    If it doesn't, tell me what is the input window type, and I wil try to help you.
    Joe Farkas
    [email protected]
    [email protected]



  3. #3
    Guest

    Re: Suggesting a name in the File Dialog

    Thanks for replying Joe, but actually I was just using the windows default File Dialog:
    CFileDialog dlg(FALSE);
    Is there any way I could have a name for the file to be saved as it already in using the CFileDialog like so up above?
    Thanks


  4. #4
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: Suggesting a name in the File Dialog

    Look up CFileDialog in the Help...

    The third parameter can be a default file name....

    CString m_szNewEDLName = "MyFileName.ext";

    CFileDialog dlg(FALSE, _T("ext"), m_szNewEDLName, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, _T("(Your file type) Files (*.ext)|*.ext|All Files (*.*)|*.*||"));

    Rail

    Recording Engineer/Software Developer
    Rail Jon Rogut Software
    [email protected]
    http://home.earthlink.net/~railro/

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