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. connecting between two dialogs

connecting between two dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
c++learning
3 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.
  • O Offline
    O Offline
    Oriented
    wrote on last edited by
    #1

    visual C++ 1. i have created a dialog based project COldDlg. 2. then i added a new dialog resource CNewDlg. 3. i need that the old dialog sees the new one and controls its member variables and when the OnOK() of the new dialog executes it returns to the old dialog. in other words i need to achieve the following commands: COldDlg::OnCalculate() { CNewDlg dlg2; dlg2.DoModal(); m_new=m_old;// where m_old,m_new are 2 member variables of the old and new dialoge respectively } when i made the above statements the builder tells me that CNewDlg is undefined declaration. can anyone give me a detailed answer(in steps and forward plzzzzzzz) i can rebuild the new dialog again if needed:laugh:

    V D 2 Replies Last reply
    0
    • O Oriented

      visual C++ 1. i have created a dialog based project COldDlg. 2. then i added a new dialog resource CNewDlg. 3. i need that the old dialog sees the new one and controls its member variables and when the OnOK() of the new dialog executes it returns to the old dialog. in other words i need to achieve the following commands: COldDlg::OnCalculate() { CNewDlg dlg2; dlg2.DoModal(); m_new=m_old;// where m_old,m_new are 2 member variables of the old and new dialoge respectively } when i made the above statements the builder tells me that CNewDlg is undefined declaration. can anyone give me a detailed answer(in steps and forward plzzzzzzz) i can rebuild the new dialog again if needed:laugh:

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      Your example is incomplete. What are m_new and m_old? Kuphryn

      1 Reply Last reply
      0
      • O Oriented

        visual C++ 1. i have created a dialog based project COldDlg. 2. then i added a new dialog resource CNewDlg. 3. i need that the old dialog sees the new one and controls its member variables and when the OnOK() of the new dialog executes it returns to the old dialog. in other words i need to achieve the following commands: COldDlg::OnCalculate() { CNewDlg dlg2; dlg2.DoModal(); m_new=m_old;// where m_old,m_new are 2 member variables of the old and new dialoge respectively } when i made the above statements the builder tells me that CNewDlg is undefined declaration. can anyone give me a detailed answer(in steps and forward plzzzzzzz) i can rebuild the new dialog again if needed:laugh:

        D Offline
        D Offline
        Dimenser
        wrote on last edited by
        #3

        At the top of the main dialog portion, you need to add #include "dlg2.h" to pass the variable, use m_old=Dlg2.m_new; :-D Dimenser

        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