Skip to main content
GameDev.net gamedev.net
🔒 Locked

Utilizing the CProgressCtrl :: MFC

Started by kuphryn Apr 11, 2002 at 7:06 PM 3 replies 750+ views
Original Post
kuphryn
kuphryn
Hi. Class CProgressCtrl is functionally simple and easy to understand. Nonetheless, I do have one question. How do you calculate the time duration from the start of a job (0% progression) to the completion (100% progression). For example, let say we have a program that converts all letters in a text file into uppercase. Original text file: a b c Output text file: A B C How do you implement a progression bar such that it displays the completetion animation accurately? I know the example above takes less than a second, but lets just imagine that it takes 10 *or* more. Thanks, Kuphryn
kuphryn
kuphryn
Thanks.

To my understanding, there no accurate way to handle the process completion percentage. We can approximate. Approximating is good enough for some programs.

Kuphryn
siaspete
siaspete
Yeah, this is probably why a lot of apps have jerky progress bars.

It''s easy enough when you''re linearly going through a set of items, but when you don''t know how long each item is going to take to process, it''s a bit nasty.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
kuphryn
kuphryn
Nice!

Measuring the time someting takes to complete a cycle can be difficult if the job is fast.

Consider Microsoft''s defragmentor. I do not think the programmers use the timer measure. Sometimes the progress bar jumps 20% or more.

Kuphryn

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.