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. Data from one dialog box into another dialog box

Data from one dialog box into another dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
12 Posts 8 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.
  • V Offline
    V Offline
    vc _fragrance
    wrote on last edited by
    #1

    Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

    N S R D H 5 Replies Last reply
    0
    • V vc _fragrance

      Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      vc++_fragrance wrote:

      Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

      Write one Set function to set the data into the second dialog and then display this dialog. For eg:

      void SetData( PVOID pCustomData )
      {
      m_myData = (PMYDATA) pCustomData;
      }

      Or pass the data to the constructor of the second dialog... Or use events to send the data to the second dialog and wrap the data inside the LPARAM or WPARAM parameters.


      Nibu thomas A Developer Programming tips[^]  My site[^]

      1 Reply Last reply
      0
      • V vc _fragrance

        Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

        S Offline
        S Offline
        Sakthiu
        wrote on last edited by
        #3

        Use SendMessage Function that could be helpful for you.

        T E H 3 Replies Last reply
        0
        • S Sakthiu

          Use SendMessage Function that could be helpful for you.

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          WTF !? :wtf::~


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

          S 1 Reply Last reply
          0
          • V vc _fragrance

            Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

            R Offline
            R Offline
            Rinu_Raj
            wrote on last edited by
            #5

            Suppose you are creating these dialog in some class say a dialog class CMainDlg Class CMainDlg:Public CDialog { private: Dlg1* pDlg1; Dlg2* pDLg2; ...... } Then in Class Dlg1 expose a function to Get the other dialog control's data and in class Dlg to set theat data for eg Class Dlg1:public CDilaog { public CString GetDataFrmControl(); // supposing control's data type is of type CString } Class Dlg2:public CDilaog { public void SetDataToControl( CString& Data ); // supposing control's data type is of type CString } /////////////////////////// CMainDLg::OnInitDialog { PDlg1 = new Dlg1; pDlg2 = new Dlg2; pDLg1->Create(..) pDlg2->Create(..) // pass the value from one dialog to another where ever needed pDlg2->SetDataToControl( pDLg1->GetDataFrmControl()) } Rinu Raj

            1 Reply Last reply
            0
            • T toxcct

              WTF !? :wtf::~


              TOXCCT >>> GEII power

              [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

              S Offline
              S Offline
              Sakthiu
              wrote on last edited by
              #6

              WTF ?????:-D

              T 1 Reply Last reply
              0
              • S Sakthiu

                WTF ?????:-D

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                HEY !!!!! :mad: you have a problem with your signature, don't you ? :suss:


                TOXCCT >>> GEII power

                [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

                1 Reply Last reply
                0
                • V vc _fragrance

                  Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

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

                  What is the relationship between the two dialogs? Are they siblings? Does one "own" the other? Are they both modal?


                  "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

                  "Judge not by the eye but by the heart." - Native American Proverb

                  V 1 Reply Last reply
                  0
                  • S Sakthiu

                    Use SendMessage Function that could be helpful for you.

                    E Offline
                    E Offline
                    Eytukan
                    wrote on last edited by
                    #9

                    Why not you delete this?


                    --[:jig:]-- [My Current Status] Link2006 wrote:Let's take it outside of CP Jeremy : Please don't.I would love to see this.I'm making the popcorn already.

                    1 Reply Last reply
                    0
                    • V vc _fragrance

                      Hi, I created two dialog boxes.I want to get data from a control in one dialog box into another dialog box. Can anyone say how to get it. Thank you.

                      H Offline
                      H Offline
                      Hamid Taebi
                      wrote on last edited by
                      #10

                      ///////if your main class is CMainDlg In another dialog you can use #include "MainDlg.h" CMainDlg *m_Main=GetParent(); m_Main->Yourfunction();

                      _**


                      **_

                      WhiteSky


                      1 Reply Last reply
                      0
                      • S Sakthiu

                        Use SendMessage Function that could be helpful for you.

                        H Offline
                        H Offline
                        Hamid Taebi
                        wrote on last edited by
                        #11

                        You can modify your message.

                        _**


                        **_

                        WhiteSky


                        1 Reply Last reply
                        0
                        • D David Crow

                          What is the relationship between the two dialogs? Are they siblings? Does one "own" the other? Are they both modal?


                          "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

                          "Judge not by the eye but by the heart." - Native American Proverb

                          V Offline
                          V Offline
                          vc _fragrance
                          wrote on last edited by
                          #12

                          The two dialog boxes are modal dialog boxes

                          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