Click to See Complete Forum and Search --> : How to notify a thread in VC++
novice123
September 1st, 2005, 12:11 AM
Hi,
I have two threads running, how to notify one thread from other. Is it possible ?. I am using VC++ 7.0
Please let me know .
thanks
darwen
September 1st, 2005, 12:18 AM
What do you want to notify ?
There's many ways of doing this really. If you're running a UI thread (i.e. a thread which is derived from CWinThread) you can create a window in one of the threads and call PostMessage on the HWND from the other one to pass a message.
You can also pass messages by having a synchronised list of messages in one thread, and an event to signal that thread that messages exist.
It really depends on what you want to do.
Darwen.
Naumaan
September 1st, 2005, 12:30 AM
If u want to notify one thread from another thread e.g like one thread have completed its work and notify other thread after that to execute its task, then u can use waitforsingleobject or waitformultipleobject . Check MSDN for further references.
Ejaz
September 1st, 2005, 12:49 AM
[ Redirected Thread ]
kuphryn
September 3rd, 2005, 02:29 AM
Another possible solution is messages.
Kuphryn
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.