Threading And UI in 2005

i just had to get some work done on the laptop and since i have only 2005 on the laptop i was forced to run the project from VS 2005. well i thought i will have no problem since it is nothing beyond moving C# code from one place to the other. i was rigth it compiled straight up… but….. DEBUG went Jambalaya!!. it sends a strange threading error that i have not encountered in the same project in VS2003.
the error is “Illegal cross-thread operation: Control ‘lbl1’ accessed from a thread other than the thread it was created on.”
it means that i am running some thing in the GUI from a thread that is not the Thread of the GUI…. but i didnt do this. i am in the same thread… apearantly not. i was fooling around with the code.
looked around in the net and vuala.
Threading With Windows Forms
and for the Error i have 2 google pointers to some group conversations:
1 Yossi gets annoyed on the microsoft way. but there is some info in this place( not the best point to look for it) Here
2 Here there is an example on the subject (better then the first link) Here
now i am going to fix my code…
See ya later

Speak Your Mind


This site uses Akismet to reduce spam. Learn how your comment data is processed.