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. Communication among Components

Communication among Components

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comhelptutorial
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.
  • N Offline
    N Offline
    Nathan Hoffman
    wrote on last edited by
    #1

    I'm working on a personal project using MFC. I'm still a beginner with it, however One thing that I'm having problems with is trying to figure out how to communicate between the different components of my application. I have a Main Frame window with the Report Control View (http://www.codeproject.com/miscctrl/reportctrl.asp), a toolbar, and a menu. Now, what I would like to do is allow the user to delete/edit entries in the view using the keyboard (catching windows messages for the view) and also using the toolbar and menu on the main window. How can I communicate with the view through the main window class? I'm finding it confusing trying to figure out the message maps for both view and frame. I'm sure it will fall together when I get other peoples' ideas. I hope my description wasn't too confusing :) Any help will be appreciated.

    F C 2 Replies Last reply
    0
    • N Nathan Hoffman

      I'm working on a personal project using MFC. I'm still a beginner with it, however One thing that I'm having problems with is trying to figure out how to communicate between the different components of my application. I have a Main Frame window with the Report Control View (http://www.codeproject.com/miscctrl/reportctrl.asp), a toolbar, and a menu. Now, what I would like to do is allow the user to delete/edit entries in the view using the keyboard (catching windows messages for the view) and also using the toolbar and menu on the main window. How can I communicate with the view through the main window class? I'm finding it confusing trying to figure out the message maps for both view and frame. I'm sure it will fall together when I get other peoples' ideas. I hope my description wasn't too confusing :) Any help will be appreciated.

      F Offline
      F Offline
      Frank Deo
      wrote on last edited by
      #2

      Nathan, Check out this article on msdn: http://support.microsoft.com/support/kb/articles/Q108/5/87.asp This article explains how to access your doc or view from anywhere in your app (code). I think its what you are looking for. Frank

      1 Reply Last reply
      0
      • N Nathan Hoffman

        I'm working on a personal project using MFC. I'm still a beginner with it, however One thing that I'm having problems with is trying to figure out how to communicate between the different components of my application. I have a Main Frame window with the Report Control View (http://www.codeproject.com/miscctrl/reportctrl.asp), a toolbar, and a menu. Now, what I would like to do is allow the user to delete/edit entries in the view using the keyboard (catching windows messages for the view) and also using the toolbar and menu on the main window. How can I communicate with the view through the main window class? I'm finding it confusing trying to figure out the message maps for both view and frame. I'm sure it will fall together when I get other peoples' ideas. I hope my description wasn't too confusing :) Any help will be appreciated.

        C Offline
        C Offline
        Cathy
        wrote on last edited by
        #3

        How can I communicate with the view through the main window class? 2 ideas: CFrameWnd::GetActiveView() and cast to your view class or keep a pointer to your view as a member of your frame class. Set it in OnCreate(...) Now if only someone would answer my question. I did this for good karma :)

        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