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. Dialog class

Dialog class

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
2 Posts 2 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.
  • D Offline
    D Offline
    danag
    wrote on last edited by
    #1

    How do I access a documents data from the dialog? Is there any function for doing? I know abt the GetDocument() that can be used in the View to access Document's data.. can anyone help me? Thanks

    C 1 Reply Last reply
    0
    • D danag

      How do I access a documents data from the dialog? Is there any function for doing? I know abt the GetDocument() that can be used in the View to access Document's data.. can anyone help me? Thanks

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

      no, there is no function in CDialog for accessing a CDocument. you either have to give your dialog a pointer (or reference) to your CDoc or copy data to and from the dialog using member functions of the dialog (or variables).

      void CMyDoc::OnX()
      {
      CMyDialog dlg;
      dlg.m_data = m_data;
      if (dlg.DoModal()==IDOK)
      {
      m_data = dlg.m_data;
      }
      }

      or:

      void CMyDoc::OnX()
      {
      CMyDialog dlg;
      dlg.m_pDoc = this;
      dlg.DoModal();
      }
      ...
      class CMyDialog
      {
      ...
      public:
      CMyDoc *m_pDoc;
      }

      -c


      "Kate said / The flowers of intolerance and hatred / Are blooimg kind of early this year / Someone's been watering them. -- Robyn Hitchcock, Devil's Radio

      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