We help IT Professionals succeed at work.
Get Started

CProgressCtrl Bar Not Displaying Accurate Progression

1,598 Views
Last Modified: 2012-05-10
Hello EE,

I am making a program that reads a file, does its calculations, and outputs the calculations.

The filenames are stored in a series of std::vectors and the program goes through each one until it is finished.

While this is happening, a dialog with a CProgressCtrl variable is displayed to indicate the progress of the process, calling StepIt() every time a file is finished outputting the file.

However, it does not depict an accurate progression as it continually shows a complete bar and then an empty bar again which continues to progress to a complete bar then empties again.

I am initialising the range like this:

int max = vector1.size() + vector2.size() + vector3.size();
ProgressBar.SetRange( 0 , max );
ProgressBar.SetStep(1);

If someone can tell me what I am doing wrong, it would be greatly appreciated.

Thanks.


Comment
Watch Question
Freelance programmer / Consultant
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE