Re: WindowsForms don't works correctly with multithreading?
Jacob Grass <[email protected]> Thu, 20 Jun 2002 07:54:19 -0500
| Newsgroups | gmane.comp.windows.devel.dotnet.general |
|---|---|
| Message-ID | <B3E64044BDEAD54B9FCAA9747B2A729F3FCDD2@ASMAIL.corp.abilitisolutions.net> |
If you are going to update the UI from a thread which does not own the UI elements, you need to use Control.Invoke to marshal between the threads. Jacob A. Grass -----Original Message----- From: Luca Marchesi [mailto:[email protected]] Sent: Thursday, June 20, 2002 5:01 AM To: [email protected] Subject: [DOTNET] WindowsForms don't works correctly with multithreading? You know that WindowsForms applications must run in a STA apartment, because of the underlying technologies such as OLE that requires STA. Some days ago I read that ThreadPool uses a MTA apartment (obvoiusly): are there any problems in using WindowsForms with ThreadPool? Moreover: a control can be accessed only by the thread that created it. If in a WindowsForms app I start a new thread and that thread modifies something in the forms what happens? A thread handler run inside the thread that fired the event: if the form handle an event raised by an other thread and the event handler modifies some properties of the form itself, are tehere any conflicts? In short: are there any conflicts in working with multithreading WIndowsForms apps? If so, which? Thanks, Luca You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.