L
Lisa B.
It appears that this was possible in Visual Studio 2003, but no longer works
in 2005.
Let me state the problem more fully.
In my main thread, I have a class with an event handler. In the code for
this class, I create an instance of my worker class, and call one of the
methods of this worker class using a separate thread. The worker method
raises the event which my event handler is listening for.
Well, as it turns out, in VS2005, the event handler code is executed IN THE
SAME THREAD as the background method which raised the event. This really
sucks, because any code to update the GUI will fail.
Has anyone else noticed this? And is there some kind of workaround? I was
really hoping to have some way for an event raised in my background thread
to be able to trigger an event handler which executes in the main thread.
Thanks if you can help!
Lisa B.
in 2005.
Let me state the problem more fully.
In my main thread, I have a class with an event handler. In the code for
this class, I create an instance of my worker class, and call one of the
methods of this worker class using a separate thread. The worker method
raises the event which my event handler is listening for.
Well, as it turns out, in VS2005, the event handler code is executed IN THE
SAME THREAD as the background method which raised the event. This really
sucks, because any code to update the GUI will fail.
Has anyone else noticed this? And is there some kind of workaround? I was
really hoping to have some way for an event raised in my background thread
to be able to trigger an event handler which executes in the main thread.
Thanks if you can help!
Lisa B.