Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upgrading VS2003 solution to VS2005
Message
 
À
01/02/2006 15:32:15
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01092432
Message ID:
01092692
Vues:
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.

Does that mean that v1.1 was a little more relaxed regarding who accessed a thread?
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform