C backgroundworker progress bar not updating
In loading images function i am inserted the following code to show progress bar.
m_Dlg = new Prog Dlg(this); m_Dlg- For this, i wrote one function in progress bar class and set image index to that function.
The following example demonstrates the use of a Background Worker to update a Win Forms Progress Bar.
The background Worker will update the value of the progress bar without blocking the UI thread, thus showing a reactive UI while work is done in the background.
I know i have to basically start a new thread so the progress bar and method can do work in sync. I dont stop the progress bar for testing reasons and, as expected, it starts going once the Geocode These(ref ai List) method is done.
Your code has priority over lower functions like updating so when you start loading the images all resource of your thread go to doing so, and the UI will 'frees' and not update since something else (the loading function) is using it.call this function in for loop in loading images function. Set Pos(count); this code is used to update progress bar. Implement Back Ground Worker threads to solve this problem.Please help me to implement Back Ground Worker threads in VC .Hello all, I am using Microsoft visual C 8 for development. I am trying to show a progress bar while my process is going on.i.e loading images.., while this progress is under process minimize the current application and maximize the progress bar is not working properly that means application shows blank area. visual C will make a new thread for you application to run in, this means your code and the UI will run in this thread. Without knowing your code and from what you posted I take it that you are loading the images in your main or UI thread.