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. Accessing CFooDoc CFooView from CFooDlg

Accessing CFooDoc CFooView from CFooDlg

Scheduled Pinned Locked Moved C / C++ / MFC
comhelptutorialquestionannouncement
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.
  • L Offline
    L Offline
    loic
    wrote on last edited by
    #1

    Hello, I just can't find how to access my current Doc or View class from my Dialog. I have a simple document application, and my dialog is a toolbar (http://www.codeproject.com/miscctrl/rollupctrl.asp). If I click on a button of my toolbar, it executes : void CFooDlg::OnButtonMyAction() So I want here to access my current document, update it, and then update the view. It looks like a very basic question, but I can't figure out how to do that. Thank you for your help, loic

    H 1 Reply Last reply
    0
    • L loic

      Hello, I just can't find how to access my current Doc or View class from my Dialog. I have a simple document application, and my dialog is a toolbar (http://www.codeproject.com/miscctrl/rollupctrl.asp). If I click on a button of my toolbar, it executes : void CFooDlg::OnButtonMyAction() So I want here to access my current document, update it, and then update the view. It looks like a very basic question, but I can't figure out how to do that. Thank you for your help, loic

      H Offline
      H Offline
      Hernan Breinbauer
      wrote on last edited by
      #2

      If your dialog is a toolbar, wht you shoukld do is handle the action (button pressed, or other) on your doc class. You can use the class wizard for that, or you can do it by hand and add an entry on the DOC message map to catch the action. Good luck. Hernan

      L 1 Reply Last reply
      0
      • H Hernan Breinbauer

        If your dialog is a toolbar, wht you shoukld do is handle the action (button pressed, or other) on your doc class. You can use the class wizard for that, or you can do it by hand and add an entry on the DOC message map to catch the action. Good luck. Hernan

        L Offline
        L Offline
        loic
        wrote on last edited by
        #3

        :) thx, I will do that through the associate view, so I can easily manage the redraw of the data. loic

        H 1 Reply Last reply
        0
        • L loic

          :) thx, I will do that through the associate view, so I can easily manage the redraw of the data. loic

          H Offline
          H Offline
          Hernan Breinbauer
          wrote on last edited by
          #4

          Easier and better if you do that in the document and then call UpdateAllViews(NULL);

          L 1 Reply Last reply
          0
          • H Hernan Breinbauer

            Easier and better if you do that in the document and then call UpdateAllViews(NULL);

            L Offline
            L Offline
            loic
            wrote on last edited by
            #5

            Thank you! With all the possibilities, creating a well organised structure for a windows program is not so easy, especially when wanting to do it as modular as possible. loic

            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