Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Upgrading VS2003 solution to VS2005
Message
From
01/02/2006 15:32:15
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01092432
Message ID:
01092550
Views:
17
>I ran the upgrading wizard on my solution to upgrade from VS2003 to VS2005. The conversion ran fine without errors or even warnings, and the app compiles just fine. But when I try to run it I catch the following run-time exception:
>
>System.InvaildOperationException: Cross-thread operation not valid: Control 'myControl' accessed from a thread other than the thread it was created on.
>
>
>I was not aware that they (M$) made such "big" changes to the threading in 2.0. The problem is that I know that I am accessing the thread from a thread other than the thread it was created on, but that is how I want it:)
>Here is what I am doing:
>In the app's Main() I start a splash screen (with a progress bar and all that sexy stuff). I could close the splash screen from the app's Main() right before I launch the main form, but I would rather close the splash screen (with a nice fading effect) from the main form's layout event (this way the splash is fading away immediately after the main form is displayed). This looks very nice when built in VS2003.
>
>Any thoughts on this would be nice. When do you close your splash screen?
>
>Einar

Einar,

You didn't post the code that throws the error so all I can say is that you have to use a delegate to handle a raised event in another thread.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform