|
-
April 29th, 2007, 09:40 AM
#4
Re: Get value of a control in a property page in thread safe manner
The reason I'm worried about thread safety issues is that I make updates to the list control from a separate thread.
Repeat after me..."Windows Controls should only be updated from the Thread that created them, and this thread must be a UI thread (i.e. it has a message pump)"...Repeat again and again.
The proper design is for you to update some variable/structure with the desired information, post a message to the main thread (or use some other mechanism to indicate that an update is available), and then have the main thread update the actual control.
Any other implementation will eventually lead to difficulties, unreliable program operation, maintenance issues, etc.....
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
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
|