Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFileDialog SaveAs Question

CFileDialog SaveAs Question

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moobob
    wrote on last edited by
    #1

    Is there anyway to change the Save button text of the SaveAs dialog of the CFileDialog class to be something else? Thanks in advance, Bob

    C 1 Reply Last reply
    0
    • M moobob

      Is there anyway to change the Save button text of the SaveAs dialog of the CFileDialog class to be something else? Thanks in advance, Bob

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      derive a class from CFileDialog. override OnInitDialog. then, do this:

      GetParent()->GetDlgItem(IDOK)->SetWindowText("My new label");

      -c


      To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
         /. #3848917

      image effects!

      M I 2 Replies Last reply
      0
      • C Chris Losinger

        derive a class from CFileDialog. override OnInitDialog. then, do this:

        GetParent()->GetDlgItem(IDOK)->SetWindowText("My new label");

        -c


        To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
           /. #3848917

        image effects!

        M Offline
        M Offline
        moobob
        wrote on last edited by
        #3

        Chris, Thanks for your response. I tried as you suggested, but it crashes. If I do a CFileDialog dlg(FALSE, "*.imp", NULL, NULL, szFilter); CWnd *wnd = dlg.GetDlgItem(IDOK); it crashes on the dlg.GetDlgItem call. dlg.hWnd = 0. Perhaps I'm doing this in the wrong place? Thanks, Bob

        C 1 Reply Last reply
        0
        • M moobob

          Chris, Thanks for your response. I tried as you suggested, but it crashes. If I do a CFileDialog dlg(FALSE, "*.imp", NULL, NULL, szFilter); CWnd *wnd = dlg.GetDlgItem(IDOK); it crashes on the dlg.GetDlgItem call. dlg.hWnd = 0. Perhaps I'm doing this in the wrong place? Thanks, Bob

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          moobob wrote: Perhaps I'm doing this in the wrong place? yup 1. derive a class from CFileDialog (you have to make a new class, not just instantiate a CFileDialog). ClassWizard can help with this. 2. override OnIntiDialog in that derived class (not in the class that uses the new CFileDialog) 3. put that line of code in the derived class's OnInitDialog -c


          To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
             /. #3848917

          image effects!

          M 1 Reply Last reply
          0
          • C Chris Losinger

            moobob wrote: Perhaps I'm doing this in the wrong place? yup 1. derive a class from CFileDialog (you have to make a new class, not just instantiate a CFileDialog). ClassWizard can help with this. 2. override OnIntiDialog in that derived class (not in the class that uses the new CFileDialog) 3. put that line of code in the derived class's OnInitDialog -c


            To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
               /. #3848917

            image effects!

            M Offline
            M Offline
            moobob
            wrote on last edited by
            #5

            Thanks Chris!

            1 Reply Last reply
            0
            • C Chris Losinger

              derive a class from CFileDialog. override OnInitDialog. then, do this:

              GetParent()->GetDlgItem(IDOK)->SetWindowText("My new label");

              -c


              To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
                 /. #3848917

              image effects!

              I Offline
              I Offline
              includeh10
              wrote on last edited by
              #6

              ur reply to the poster is very interesting. if GetParent() gets the dialog, what does m_hWnd of the new class stand for? thx includeh10

              C 1 Reply Last reply
              0
              • I includeh10

                ur reply to the poster is very interesting. if GetParent() gets the dialog, what does m_hWnd of the new class stand for? thx includeh10

                C Offline
                C Offline
                Chris Losinger
                wrote on last edited by
                #7

                i don't know. that's just code i've always used without even looking at it. it works fine. -c


                To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses.
                   /. #3848917

                image effects!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups