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. Assigning parent to a Dialog

Assigning parent to a Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 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
    doctorpi
    wrote on last edited by
    #1

    Hi Guys I've got my CMyFormView class I define a Dialog and Create a Class for this dialog called CMyDialog From CMyFormView I call an instance of CMyDialog Ex: . . . CMyDialog dlgTest; dlgTest.DoModal(); . . . What's the right way to acces from inside dlgTest the CMyFormView members? (I could continue the question with... ...to avoid that each time that I touch the CMyDialog.h the complete app recompiles ?) Ex: BOOL CMyDialog::OnInitDialog() { CDialog::OnInitDialog(); // Write code here to acces m_nNumber a int variable declared in CMyFormView.h return TRUE; } Thanks

    L 1 Reply Last reply
    0
    • D doctorpi

      Hi Guys I've got my CMyFormView class I define a Dialog and Create a Class for this dialog called CMyDialog From CMyFormView I call an instance of CMyDialog Ex: . . . CMyDialog dlgTest; dlgTest.DoModal(); . . . What's the right way to acces from inside dlgTest the CMyFormView members? (I could continue the question with... ...to avoid that each time that I touch the CMyDialog.h the complete app recompiles ?) Ex: BOOL CMyDialog::OnInitDialog() { CDialog::OnInitDialog(); // Write code here to acces m_nNumber a int variable declared in CMyFormView.h return TRUE; } Thanks

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      doctorpi wrote:

      What's the right way to acces from inside dlgTest the CMyFormView members?

      The dialog should not access the View members. See the Model-View-Controller Design Pattern.

      led mike

      D 2 Replies Last reply
      0
      • L led mike

        doctorpi wrote:

        What's the right way to acces from inside dlgTest the CMyFormView members?

        The dialog should not access the View members. See the Model-View-Controller Design Pattern.

        led mike

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

        Thanks, I knew I missed something ;P

        1 Reply Last reply
        0
        • L led mike

          doctorpi wrote:

          What's the right way to acces from inside dlgTest the CMyFormView members?

          The dialog should not access the View members. See the Model-View-Controller Design Pattern.

          led mike

          D Offline
          D Offline
          doctorpi
          wrote on last edited by
          #4

          Just one question then. If I want to modify from the CMyDialog the CDocument it's mandatory include the CMyDocument.h ? Then always the complete app is recompiled if I add a member to my CMyDialog? And then If CMyDialog affects CMyFormView (through CMyDocument) I have to update with Updateallviews from CMyDocument? Thanks -- modified at 14:31 Wednesday 11th April, 2007

          L 1 Reply Last reply
          0
          • D doctorpi

            Just one question then. If I want to modify from the CMyDialog the CDocument it's mandatory include the CMyDocument.h ? Then always the complete app is recompiled if I add a member to my CMyDialog? And then If CMyDialog affects CMyFormView (through CMyDocument) I have to update with Updateallviews from CMyDocument? Thanks -- modified at 14:31 Wednesday 11th April, 2007

            L Offline
            L Offline
            led mike
            wrote on last edited by
            #5

            doctorpi wrote:

            it's mandatory include the CMyDocument.h ?

            Not mandatory. You can create a Controller for the Dialog that isolates it from the document.

            led mike

            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