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. Passing parameters to a Dialog

Passing parameters to a Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++com
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.
  • S Offline
    S Offline
    Sayan Mukherjee
    wrote on last edited by
    #1

    Hi, I have a dialog-based MFC application. In response to a button click on the dialog I need another dialog to popup. So far so good. I also need the text in an edit field in Dialog_1 to appear in an edit field in Dialog_2. In short, I need parameters to be passed from one window to another. How can I do this? With best regards, Sayan Mukherjee (sayanmukherjee@indiatimes.com)

    T L 2 Replies Last reply
    0
    • S Sayan Mukherjee

      Hi, I have a dialog-based MFC application. In response to a button click on the dialog I need another dialog to popup. So far so good. I also need the text in an edit field in Dialog_1 to appear in an edit field in Dialog_2. In short, I need parameters to be passed from one window to another. How can I do this? With best regards, Sayan Mukherjee (sayanmukherjee@indiatimes.com)

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Add data members do dialog2 and initialize them before calling DoModal. Tomasz Sowinski -- http://www.shooltz.com
      ** If you're going to rape, pillage and burn, be sure to do things in that order. **

      S L 2 Replies Last reply
      0
      • S Sayan Mukherjee

        Hi, I have a dialog-based MFC application. In response to a button click on the dialog I need another dialog to popup. So far so good. I also need the text in an edit field in Dialog_1 to appear in an edit field in Dialog_2. In short, I need parameters to be passed from one window to another. How can I do this? With best regards, Sayan Mukherjee (sayanmukherjee@indiatimes.com)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        hi, If you want a very stable mechanism,go for user defined messages. else get the data from one dialog and store it in mainframe and display it in the second dialog.Mainframe because it is present as long as the app is running;you may also use App class. hope it helped Rajendra Gowda

        1 Reply Last reply
        0
        • T Tomasz Sowinski

          Add data members do dialog2 and initialize them before calling DoModal. Tomasz Sowinski -- http://www.shooltz.com
          ** If you're going to rape, pillage and burn, be sure to do things in that order. **

          S Offline
          S Offline
          Sayan Mukherjee
          wrote on last edited by
          #4

          Hi, Thanks for the answer. It was really helpful. A related question: In Windows SDK, each window has a place where a 32 bit pointer can be passed which is accessible from other windows. Using the heap, one can pack any amount of data and pass it. Is there any equivalent to that under MFC? I am sorry if the question is vague. With best regards, Sayan Email:sayanmukherjee@indiatimes.com

          T R 2 Replies Last reply
          0
          • T Tomasz Sowinski

            Add data members do dialog2 and initialize them before calling DoModal. Tomasz Sowinski -- http://www.shooltz.com
            ** If you're going to rape, pillage and burn, be sure to do things in that order. **

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Your comment is FILTHY You are SICK

            T 1 Reply Last reply
            0
            • S Sayan Mukherjee

              Hi, Thanks for the answer. It was really helpful. A related question: In Windows SDK, each window has a place where a 32 bit pointer can be passed which is accessible from other windows. Using the heap, one can pack any amount of data and pass it. Is there any equivalent to that under MFC? I am sorry if the question is vague. With best regards, Sayan Email:sayanmukherjee@indiatimes.com

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              Sayan Mukherjee wrote: In Windows SDK, each window has a place where a 32 bit pointer can be passed which is accessible from other windows. I'm not sure what you're referring to - WPARAM/LPARAM passed with messages or extra bytes per window which you request during class registration? Tomasz Sowinski -- http://www.shooltz.com
              ** If you're going to rape, pillage and burn, be sure to do things in that order. **

              1 Reply Last reply
              0
              • L Lost User

                Your comment is FILTHY You are SICK

                T Offline
                T Offline
                Tomasz Sowinski
                wrote on last edited by
                #7

                Did you forget to take your pills today? Tomasz Sowinski -- http://www.shooltz.com
                ** If you're going to rape, pillage and burn, be sure to do things in that order. **

                N 1 Reply Last reply
                0
                • T Tomasz Sowinski

                  Did you forget to take your pills today? Tomasz Sowinski -- http://www.shooltz.com
                  ** If you're going to rape, pillage and burn, be sure to do things in that order. **

                  N Offline
                  N Offline
                  Nish Nishant
                  wrote on last edited by
                  #8

                  Hi Tomasz Initially I was confused as to his post too. The I guessed. The sig must have upset him. Or if I guess right "upset her". The anonymous poster is in all probability a woman Your sig :- "** If you're going to rape, pillage and burn, be sure to do things in that order. **" Nish p.s. don't worry Tomasz. different people have different senses and levels of humor. _I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me._

                  T 1 Reply Last reply
                  0
                  • S Sayan Mukherjee

                    Hi, Thanks for the answer. It was really helpful. A related question: In Windows SDK, each window has a place where a 32 bit pointer can be passed which is accessible from other windows. Using the heap, one can pack any amount of data and pass it. Is there any equivalent to that under MFC? I am sorry if the question is vague. With best regards, Sayan Email:sayanmukherjee@indiatimes.com

                    R Offline
                    R Offline
                    Ravi Bhavnani
                    wrote on last edited by
                    #9

                    Sayan Mukherjee wrote: Is there any equivalent to that under MFC? To the best of my knowledge, no. If you're using MFC, your Window subclassed object should have a data member that you can set and get. Of course, you could always access a CWnd derived class' public m_hWnd member, but that's nasty! /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

                    1 Reply Last reply
                    0
                    • N Nish Nishant

                      Hi Tomasz Initially I was confused as to his post too. The I guessed. The sig must have upset him. Or if I guess right "upset her". The anonymous poster is in all probability a woman Your sig :- "** If you're going to rape, pillage and burn, be sure to do things in that order. **" Nish p.s. don't worry Tomasz. different people have different senses and levels of humor. _I am looking for a free racing game. Old style racing game without any complicated 3D stuff. Around 4 MB download. If anyone has such a game, please inform me._

                      T Offline
                      T Offline
                      Tomasz Sowinski
                      wrote on last edited by
                      #10

                      Nish [BusterBoy] wrote: don't worry Tomasz. different people have different senses and levels of humor I'm absolutely not worried. Actually, I was thinking about changing the sig - it's about week old. But now I'll keep it for another week :) Tomasz Sowinski -- http://www.shooltz.com
                      ** If you're going to rape, pillage and burn, be sure to do things in that order. **

                      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