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. worker thread communicate with user interface

worker thread communicate with user interface

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

    hi, apart from using PostMessage(), i want to any method or example like callback function, or similar to delegate in C#. so that, worker thread able to communicate with user interface on a event. i want to learn more on this. any help? thanks! jim.

    A 1 Reply Last reply
    0
    • Z zecodela

      hi, apart from using PostMessage(), i want to any method or example like callback function, or similar to delegate in C#. so that, worker thread able to communicate with user interface on a event. i want to learn more on this. any help? thanks! jim.

      A Offline
      A Offline
      Abhishek Srivastava
      wrote on last edited by
      #2

      Hi, Have u tried PostThreadMessage() API , using this API u can post ur event message to ur worket thread. for e.g void yourFunction() { BOOL success = PostThreadMessage( idThread, your thread ID Msg, // message wParam, // first message parameter lParam // second message parameter ); } and in your Thread... DWORD WINAPI yourThreadProc(void *ptr) { MESSAGE msg; while(GetMessage(&msg,NULL, 0,0) { switch(msg.message) { ---do your work accordingly --- } } } Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

      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