error while opening new window from a Asynchronou callback function
-
Hi all. When I open a new window from an Asynchronou CallBack Function, an Exception is thrown. The Exception is "The calling thread must be STA, because many UI components require this wpf" If I set ApartmentState of the thread to STA using the code Thread.CurrentThread.SetApartmentState(ApartmentState.STA) it is not working...showing an error Failed to set the specified COM apartment state. How can I open a new window from different Thread, and modify the controls contents? Please Help me to solve this problem... Thanks in Advance Vayanan
-
Hi all. When I open a new window from an Asynchronou CallBack Function, an Exception is thrown. The Exception is "The calling thread must be STA, because many UI components require this wpf" If I set ApartmentState of the thread to STA using the code Thread.CurrentThread.SetApartmentState(ApartmentState.STA) it is not working...showing an error Failed to set the specified COM apartment state. How can I open a new window from different Thread, and modify the controls contents? Please Help me to solve this problem... Thanks in Advance Vayanan
vayanan wrote:
How can I open a new window from different Thread
You can't.
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.