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. PostMessage

PostMessage

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

    I have a Dialog based application . I want to post message from this dialog to another class which is alos part of the same application. Say When I click a button,this dialog posts a message to another class. How should I achieve this? how should I know about the class recieve that particular message? Pls guide me with sample code. Regards YKUT

    S 1 Reply Last reply
    0
    • Y ykutanoor

      I have a Dialog based application . I want to post message from this dialog to another class which is alos part of the same application. Say When I click a button,this dialog posts a message to another class. How should I achieve this? how should I know about the class recieve that particular message? Pls guide me with sample code. Regards YKUT

      S Offline
      S Offline
      Shay Harel
      wrote on last edited by
      #2

      put that in the first dialog const unsigned int wm_uiImportDone=RegisterWindowMessage("Import_Done"); give wm_uiImportDone as a pointer to the class on the class, mae sure to add that to the message map ON_REGISTERED_MESSAGE(wm_uiImportDone, OnImportDone) then on the dialog, use: ::PostMessage (m_hWnd, wm_uiImportDone, 0, 0); when m_hwnd is a pointer to the class that has to be derived from a window to get a message

      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