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. Message_Map MFC vc++

Message_Map MFC vc++

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
2 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.
  • M Offline
    M Offline
    Member_14575556
    wrote on last edited by
    #1

    In the below code snippet, why do we use '&' ? Is it because we're passing the reference of the member function?

    BEGIN_MESSAGE_MAP(CMFCListViewDoc, CDocument)
    ON_COMMAND(ID_MYCOMMAND, &CMFCListViewDoc::OnMycommand) // why do we use '&'
    END_MESSAGE_MAP()

    Excuse me for this question. It's like I know and I don't know too :).

    CPalliniC 1 Reply Last reply
    0
    • M Member_14575556

      In the below code snippet, why do we use '&' ? Is it because we're passing the reference of the member function?

      BEGIN_MESSAGE_MAP(CMFCListViewDoc, CDocument)
      ON_COMMAND(ID_MYCOMMAND, &CMFCListViewDoc::OnMycommand) // why do we use '&'
      END_MESSAGE_MAP()

      Excuse me for this question. It's like I know and I don't know too :).

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      &CMFCListViewDoc::OnMycommand is a pointer to the member function. See, for instance IBM Knowledge Center: Pointers to members (C++ only)[^]

      In testa che avete, signor di Ceprano?

      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