can not see progress in the progress Bar
-
After I add a progess bar on the dialogue box, I added code: m_progress1.SetRange(0,100); m_progress1.SetStep(1); in OnInitDialog(), and m_progress1.SetPos(mmtt); in the Next(). WHen I tried to run the program, the blue blocks representing the progress can not be seen in the progress bar. In other words, the progress bar is only an empty rectangular grew box when I run the program until finish. Please help how to make it work. Thanks
-
After I add a progess bar on the dialogue box, I added code: m_progress1.SetRange(0,100); m_progress1.SetStep(1); in OnInitDialog(), and m_progress1.SetPos(mmtt); in the Next(). WHen I tried to run the program, the blue blocks representing the progress can not be seen in the progress bar. In other words, the progress bar is only an empty rectangular grew box when I run the program until finish. Please help how to make it work. Thanks
mrby123 wrote:
...and m_progress1.SetPos(mmtt); in the Next().
When does
Next()
get called? What is the value ofmmtt
?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
mrby123 wrote:
...and m_progress1.SetPos(mmtt); in the Next().
When does
Next()
get called? What is the value ofmmtt
?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Are you aware that if you have a lenghty operation in the main thread, UI messages won't be processed until the task is finished ? This means that the UI won't be redrawn and you won't be able to see any progress in the bar until the end of the task (in which case, all messages are processed at once and the progress is full). A better approach would be to run your lenghty task in a separate thread. I really recommand reading this excellent article[^] about threading.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++