BackgroundWorker in VS2010 doesn't run in another thread
I created a WinForm in Visual Studio 2010 (c++), almost the same as this example: http://msdn.microsoft.com/en-us/library/waw3xexc.aspx
but when I click on the button that "lunch" the BackgroundWorker it "stucks" the WinForm, so I can't move it or click on "stop button" for the time the function runs.
The function runs as desired - is returns the expected result, and also the progress bar is ok. It seems that the BackgroundWorker runs in the 开发者_开发百科same thread as the WinForm.
What might be the problem?
Thanks!
I found the problem.
The BackgroundWorker actually runs on another thread but it send Events of update progress too often and those events "lunch" function in the main form - that updates ProgressBar - and this funcion "stucks" the form.
精彩评论