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.