Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IS IT POSSIBLE TO CREATE A PROGRESS BAR IN C?

Status
Not open for further replies.

gismo

Technical User
Jul 24, 2002
35
US
Is it possible to create a progress bar on a message box in C. I'm creating a C dll not C++ though I'm using the MS Visual C++ compiler with no MFC as a console application.
 
Yes - the old MS tools used to do it (QuickC around 1989 vintage).

The problem is that it has to be interleaved or multi-tasked. Interleaved is complicated as you have to know when to update the bar. Multi-tasked is a lot easier.
 
If you want an example of a multitasked progress bar, mail me at tech@cup.btinternet.co.uk. It is a bit long to post on this site.
 
Just as a comment on progress bars: as a user, don't you get irritated by progress bars that zap along to 98% at lightning speed, and then get stuck there for about 5 mins? Or even the other ones, that linger around 3% creeping up at 0.03% per min for about 10 min, until you finally get bored, and then zap up to 100% in two big jumps?

It seems to me that there's a case for not writing progress bars, the way some people's work....
 
Not really - I don't really watch them. I normally kick off the installation and go do something else. Then I pop back every so often to see how far it has gone. Does anyone actually sit and watch progress bars?
 
Every chance I get. It's nice to know whether something'll last two minutes or forty-five. Whether you should sit and observe the bar's incremental blue glory or go find some CheezeIts and watch Conan. So long as there's some idea... I really abhor the hourglass as an object of bored affection.

My biggest progress bar problem comes when copying huge amounts of data in windows. A friend cleaned off his system and started anew, and backing up 80 GB across a network, well...windows gets very confused. I don't think I really have 8340473 minutes remaining. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
There is some real benefit.
A cli oriented utility that uses a progress callback
outputting a hash or period for every n bytes read
is a good way to show the user that the program is
doing something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top