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. Mapping of events -MFC Internals

Mapping of events -MFC Internals

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasedata-structuresquestion
5 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.
  • U Offline
    U Offline
    User 1149186
    wrote on last edited by
    #1

    In MFC,can somebody explain me how the mapping takes place.I mean where does the info comes -list of messages? Does it come from a database? I know that DECLARE_MESSAGE_MAP() creates 3 entries. One of which is structure of array which consists of eventsid and functions call.

    L M 2 Replies Last reply
    0
    • U User 1149186

      In MFC,can somebody explain me how the mapping takes place.I mean where does the info comes -list of messages? Does it come from a database? I know that DECLARE_MESSAGE_MAP() creates 3 entries. One of which is structure of array which consists of eventsid and functions call.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      hello blacktiger mapping of messages happens in the message map (im not trying to be smart it really does:)) DECLARE_MESSAGE_MAP is only half the story in your cpp file there is something like this BEGIN_MESSAGE_MAP(FxMarginsDlg, VDialog) //{{AFX_MSG_MAP(FxMarginsDlg) ON_BN_CLICKED(IDC_BUTTON_CLOSE, OnButtonClose) //}}AFX_MSG_MAP END_MESSAGE_MAP() this is the message map. Entries are added by the Wizard in Visual Studio or you can edit it manually. In this example the control with ID IDC_BUTTON_CLOSE is mapped to function OnButtonClose Your best bet in understading how this works is to insert a command in an empty app, add a handler as above and set a breakpoint in the handler function. When the code hits the breakpoint you can look at the call stack and trace into the MFC code. Hope this helps

      U 1 Reply Last reply
      0
      • U User 1149186

        In MFC,can somebody explain me how the mapping takes place.I mean where does the info comes -list of messages? Does it come from a database? I know that DECLARE_MESSAGE_MAP() creates 3 entries. One of which is structure of array which consists of eventsid and functions call.

        M Offline
        M Offline
        Muthukumar
        wrote on last edited by
        #3

        Check out this place. This might probably give some ideas. http://www.codersource.net/mfc\_tutorial\_Part2.html Thanks Muthu Muthukumar.V

        1 Reply Last reply
        0
        • L Lost User

          hello blacktiger mapping of messages happens in the message map (im not trying to be smart it really does:)) DECLARE_MESSAGE_MAP is only half the story in your cpp file there is something like this BEGIN_MESSAGE_MAP(FxMarginsDlg, VDialog) //{{AFX_MSG_MAP(FxMarginsDlg) ON_BN_CLICKED(IDC_BUTTON_CLOSE, OnButtonClose) //}}AFX_MSG_MAP END_MESSAGE_MAP() this is the message map. Entries are added by the Wizard in Visual Studio or you can edit it manually. In this example the control with ID IDC_BUTTON_CLOSE is mapped to function OnButtonClose Your best bet in understading how this works is to insert a command in an empty app, add a handler as above and set a breakpoint in the handler function. When the code hits the breakpoint you can look at the call stack and trace into the MFC code. Hope this helps

          U Offline
          U Offline
          User 1149186
          wrote on last edited by
          #4

          How should I map my own events and notifications in MFC? In my app I created a Dialog box in a SDI app where I have events in one Combo Box and Notifications in another Combo Box? Now I wish to map events and notifications, How should I proceed?

          L 1 Reply Last reply
          0
          • U User 1149186

            How should I map my own events and notifications in MFC? In my app I created a Dialog box in a SDI app where I have events in one Combo Box and Notifications in another Combo Box? Now I wish to map events and notifications, How should I proceed?

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Events and notifications are really different names for the same thing. I would recomend you spend some time reading MSDN and online tutorials or a good Win32 programming book.

            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