No idea, I think it's to prevent data corruption and/or thread locking
Edit:
Quote:
Originally Posted by http://msdn.microsoft.com/en-us/library/ms171728%28v=vs.80%29.aspx
Access to Windows Forms controls is not inherently thread safe. If you have two or more threads manipulating the state of a control, it is possible to force the control into an inconsistent state. Other thread-related bugs are possible as well, including race conditions and deadlocks. It is important to ensure that access to your controls is done in a thread-safe way.
So, it's not about data corruption anyways. I think it's pretty stupid though, I mean adding an item to a listbox or changing the title of a label in a seperate thread shouldn't be a problem if you know what you're doing - I'm pretty sure those things just use the PostMessage (or SendMessage) function anyways which is completely thread-safe. Microsoft is ****.
To ever so slightly expand on that... You can just turn off checking for cross thread calls... Or use super simple thread safe code to completely bypass the issue (and I guess technically make it less errorprone)
To ever so slightly expand on that... You can just turn off checking for cross thread calls... Or use super simple thread safe code to completely bypass the issue (and I guess technically make it less errorprone)
I'd rather just use Control.(Begin)Invoke methods to be honest, it's probably the best/safest way. I'm pretty sure the thread starter already knows about these methods though, since he said he wasn't asking how to do it
I'd rather just use Control.(Begin)Invoke methods to be honest, it's probably the best/safest way. I'm pretty sure the thread starter already knows about these methods though, since he said he wasn't asking how to do it
Yah I started to actually look into and use thread safe ways of accessing controls but just figured I'd mention as always that you can just turn the **** thing off.
thanatos forms 08/17/2010 - Grand Chase Philippines - 20 Replies 1st formhttp://images2.wikia.nocookie.net/__cb20100528 043435/grandchase/images/7/78/ThanatosForm1.jpg2nd formhttp://images1.wikia.nocookie.net/__cb20100528 043417/grandchase/images/2/21/ThanatosForm2.jpg3rd and final formhttp://images1.wikia.nocookie.net/__cb20100528 043254/grandchase/images/2/29/ThanatosForm3.jpg
thanatos the god of damnation
press thanks you like my post
C# forms... silly question, lol 12/30/2008 - CO2 Programming - 4 Replies I know that this is nooby, but I can`t find it anywhere. My C# form has a menustrip, a statustrip and a webbrowser in it. How can I make it so when I stretch the form, everything moves, not just the size of the form?
epvp revealed in co forms 03/17/2006 - Conquer Online 2 - 30 Replies Looks like people are going to start findin out about this site alot more maybe co will start cracking down on ppl
http://bbs.conqueronline.com/showthread.ph...& ;highlight=EPVP