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
c++visual-studiodesignquestion
5 Posts 3 Posters 2 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
    utcode
    wrote on last edited by
    #1

    Hi, In MFC, when using sending or posting message to UI in a worker threads, is better to call global ::postmessage or postmessage?. CWnd vs. MFC. :confused:

    L 1 Reply Last reply
    0
    • U utcode

      Hi, In MFC, when using sending or posting message to UI in a worker threads, is better to call global ::postmessage or postmessage?. CWnd vs. MFC. :confused:

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

      It does not matter, since CWnd::PostMessage is just a wrapper for the Win32 function.

      U 1 Reply Last reply
      0
      • L Lost User

        It does not matter, since CWnd::PostMessage is just a wrapper for the Win32 function.

        U Offline
        U Offline
        utcode
        wrote on last edited by
        #3

        within worker thread, could a pointer to CDialog access its member variables or even functions, nothing to do with its UI elements, without using postmessage or sendmessage?. I expect the answer is YES. :doh:

        L V 2 Replies Last reply
        0
        • U utcode

          within worker thread, could a pointer to CDialog access its member variables or even functions, nothing to do with its UI elements, without using postmessage or sendmessage?. I expect the answer is YES. :doh:

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

          wizQ wrote:

          I expect the answer is YES.

          No, the answer is "maybe", as it depends on the way the code is written. Without considerably more detail about your code any answer is guesswork.

          1 Reply Last reply
          0
          • U utcode

            within worker thread, could a pointer to CDialog access its member variables or even functions, nothing to do with its UI elements, without using postmessage or sendmessage?. I expect the answer is YES. :doh:

            V Offline
            V Offline
            Victor Nijegorodov
            wrote on last edited by
            #5

            You probably would like to read this great Joe Newcomer's essay about using [WorkerThreads](http://www.flounder.com/workerthreads.htm)

            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