|
-
September 1st, 2006, 05:11 PM
#1
how to get a variable parameter from another working thread in a working thread?
I wrote a MFC multithread application. the problem is that a working thread need to get a variable parameter from another working thread. How to achieve this?
Thanks.
-
September 1st, 2006, 07:49 PM
#2
Re: how to get a variable parameter from another working thread in a working thread?
PostThreadMessage()
Kuphryn
-
September 2nd, 2006, 07:47 PM
#3
Re: how to get a variable parameter from another working thread in a working thread?
 Originally Posted by Apal
I wrote a MFC multithread application. the problem is that a working thread need to get a variable parameter from another working thread. How to achieve this?
Thanks.
In your case, you can have a 'data' class with thread safe setter and getter methods that you can pass between threads. You would create an instance of this class in the mfc class and pass it to each worker thread. The worker thread would cast it to the data class and use the thread safe method to retrieve or set the data.
-
September 13th, 2006, 05:28 AM
#4
Re: how to get a variable parameter from another working thread in a working thread?
I say it's easier to go with PostThreadMessage(). That's what I use.
-Greg Dolley
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|