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. Calling MessageMap functions

Calling MessageMap functions

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • A Offline
    A Offline
    Anu_Bala
    wrote on last edited by
    #1

    Hi, I have MessageMap fucntion in Mainfrm.H I want to use this function in another class.But the messagemap functions are protected i can't use this in another class. Can i use public out of message map and declared the required fucntions in Public and then use it. Is this correct way? Or is there any other option in it. protected: //{{AFX_MSG(CMainFrame) afx_msg void OnCursessInfo(); I changed this to (after the line /}}AFX_MSG ) public: afx_msg void OnCursessInfo();

    Anu

    A 1 Reply Last reply
    0
    • A Anu_Bala

      Hi, I have MessageMap fucntion in Mainfrm.H I want to use this function in another class.But the messagemap functions are protected i can't use this in another class. Can i use public out of message map and declared the required fucntions in Public and then use it. Is this correct way? Or is there any other option in it. protected: //{{AFX_MSG(CMainFrame) afx_msg void OnCursessInfo(); I changed this to (after the line /}}AFX_MSG ) public: afx_msg void OnCursessInfo();

      Anu

      A Offline
      A Offline
      AtomAnt
      wrote on last edited by
      #2

      A message map "just" maps incoming messages to methods, it shouldn't care if the given method is accessible from outside of the class or not, so basicly making it public is ok, just not too nice. As an alternative, you could call these methods thorough the message map by using SendMessage or PostMessage.

      AtomAnt - If God wanted man to code, man would have been born without the need to sleep.

      A J 2 Replies Last reply
      0
      • A AtomAnt

        A message map "just" maps incoming messages to methods, it shouldn't care if the given method is accessible from outside of the class or not, so basicly making it public is ok, just not too nice. As an alternative, you could call these methods thorough the message map by using SendMessage or PostMessage.

        AtomAnt - If God wanted man to code, man would have been born without the need to sleep.

        A Offline
        A Offline
        Anu_Bala
        wrote on last edited by
        #3

        Thank you. I get tht.

        Anu

        1 Reply Last reply
        0
        • A AtomAnt

          A message map "just" maps incoming messages to methods, it shouldn't care if the given method is accessible from outside of the class or not, so basicly making it public is ok, just not too nice. As an alternative, you could call these methods thorough the message map by using SendMessage or PostMessage.

          AtomAnt - If God wanted man to code, man would have been born without the need to sleep.

          J Offline
          J Offline
          jon_fallon
          wrote on last edited by
          #4

          How does one get the 'UNIT message' of the, say ONPAINT, function in the other class? To get a dialog in a CTabCtrl to initialize when selected, unique identifiers (WM_APP + 1)were defined and sent. This works fine as the WindowProc function receives the message and then branches to the appropriate initialization. Would one have to do a user defined message to the WindowProc in the other class, and then issue the function call? Thanks.

          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