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. Event or funtion after click "open" button in dialog "Open,Save,Save as"

Event or funtion after click "open" button in dialog "Open,Save,Save as"

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
10 Posts 5 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.
  • N Offline
    N Offline
    nvphap
    wrote on last edited by
    #1

    Iam using MFC .I have a problem about it .I want to question about event or funtion after clik "open" button in dialog "Open,Save,Save as".Please. Thanks

    D J M 4 Replies Last reply
    0
    • N nvphap

      Iam using MFC .I have a problem about it .I want to question about event or funtion after clik "open" button in dialog "Open,Save,Save as".Please. Thanks

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      nvphap wrote:

      I want to question about event or funtion after clik "open" button...

      You need to assign a handler to the BN_CLICKED message. If you have VS6, use ClassWizard (Ctrl+W).

      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      CPalliniC N 2 Replies Last reply
      0
      • D David Crow

        nvphap wrote:

        I want to question about event or funtion after clik "open" button...

        You need to assign a handler to the BN_CLICKED message. If you have VS6, use ClassWizard (Ctrl+W).

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Is that possible? I mean he is talking about CFileDialog...

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        In testa che avete, signor di Ceprano?

        D 1 Reply Last reply
        0
        • CPalliniC CPallini

          Is that possible? I mean he is talking about CFileDialog...

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          I assumed he was talking about the button that would construct a CFileDialog object. In any case, a hook can be provided to handle the clicking of the OK or Open button before the Open dialog is dismissed.

          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          CPalliniC 1 Reply Last reply
          0
          • N nvphap

            Iam using MFC .I have a problem about it .I want to question about event or funtion after clik "open" button in dialog "Open,Save,Save as".Please. Thanks

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            nvphap wrote:

            I want to question about event or funtion after clik "open" button in dialog "Open,Save,Save as".

            When you click the Open button on such a dialog, DoModal() will return. You then have access to whatever file was selected by the user.

            "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            • D David Crow

              nvphap wrote:

              I want to question about event or funtion after clik "open" button...

              You need to assign a handler to the BN_CLICKED message. If you have VS6, use ClassWizard (Ctrl+W).

              "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              N Offline
              N Offline
              nvphap
              wrote on last edited by
              #6

              please,give me a way to post images .I think that it will easier for we understand together

              D 1 Reply Last reply
              0
              • N nvphap

                please,give me a way to post images .I think that it will easier for we understand together

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                There are tons of Web sites that allow this. Have you searched for one?

                "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                1 Reply Last reply
                0
                • D David Crow

                  I assumed he was talking about the button that would construct a CFileDialog object. In any case, a hook can be provided to handle the clicking of the OK or Open button before the Open dialog is dismissed.

                  "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  CPalliniC Offline
                  CPalliniC Offline
                  CPallini
                  wrote on last edited by
                  #8

                  DavidCrow wrote:

                  In any case, a hook can be provided to handle the clicking of the OK or Open button before the Open dialog is dismissed.

                  Actually I thought about that solution. Probably he can also roll his own class derived by CFileDialog and then override whatever he needs. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                  In testa che avete, signor di Ceprano?

                  1 Reply Last reply
                  0
                  • N nvphap

                    Iam using MFC .I have a problem about it .I want to question about event or funtion after clik "open" button in dialog "Open,Save,Save as".Please. Thanks

                    J Offline
                    J Offline
                    James R Twine
                    wrote on last edited by
                    #9

                    If you need to get access to this "event" BEFORE the file dialog is dismissed, you may need to hook the dialog.  Look up the OFN_ENABLEHOOK flag for more information.    Peace!

                    -=- James
                    Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
                    Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
                    See DeleteFXPFiles

                    1 Reply Last reply
                    0
                    • N nvphap

                      Iam using MFC .I have a problem about it .I want to question about event or funtion after clik "open" button in dialog "Open,Save,Save as".Please. Thanks

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #10

                      An easier solution was already presented to you in your previous post (not by me). Why make it more difficult by having to hook the dialog? Mark

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      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