474,120 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ (Shell/Command Line) Progress Bars

179 New Member
I've got a small application that spends quite a lot of time parsing through files/processing data that runs on a command line (Windows) or the Shell (Linux).

I thought it would be a good idea to create a progress bar which I have done before in .NET but haven't a clue where to start in C++. Could anyone give me any suggestions as to where would be a good place to start for a generic (cross platform) solution?

Thanks for your help.

Ian
Feb 6 '08 #1
1 2863
Banfa
9,065 Recognized Expert Moderator Expert
How about just output a character now and then?

If you want output a line of text first indicating 0 and 100 % and then at the relevent times in you process output another character so that the progress bar slowly fillys up

Expand|Select|Wrap|Line Numbers
  1. 0__________50__________100
  2. ------------------
  3.  
Feb 13 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
25038
by: Paul | last post by:
i have been working with vb6 for a while but never had the pleasure of using progress bars. That is until now, one of the programs i have written has just been modified so that large csv files of 100,000+ lines can be imported into a database. the import works fine but the progress bar feature is not working correctly. The progress bar is set to a max value of the number of records in the csv file, the records are then imported and the...
8
35082
by: zhiwei wang | last post by:
I remember that there is a function that could invoke shell command such as "rm" "cp", directly in .c file. But I could not recall its name, and I googled with nothing meaningful. I vaguely remember it is like: foo("cp file1 file2"); it is that simple, but cant remember. Could anyone here give me a clue?
0
1475
by: Martin Platt | last post by:
Hi, I'm looking into various options for a fairly simple backup utility for our application. I have no problems being able to backup, find restorable backup files, and restore then. What I'd like to be able to do is hook into some event in Sql that would allow me to show progress of these tasks.
4
15110
by: Kevin Mansel via .NET 247 | last post by:
Ok, basically this is my problem. I'm building a console app tocall a dos program. So i'm using the Shell command to call theprogram, now depending on what happens, I want to read theoutput that this program returns. I'm just missing the stepshere. I know that I can set the Shell command to an integer,but this only returns a 0 to me telling me that it executed, notwhat is being returned to the console by that application. Isthere a way to...
5
2442
by: Keith Rebello | last post by:
I have a couple of progress bars that indicate the progress of a math-intensive application. They are working well. The only problem is that the progress indicator is gray in color. Is it possible to change the color of the bars - they're usually blue in other applications? Any help would be greatly appreciated. I'm using VB.Net Standard, 2003.
1
2557
by: Mike Charney | last post by:
I am trying to shell out to run a VB script file. I do not need to track the progress of the shell. It can fire off and then the VBA code can continue. The code I have is: hTask = Shell("c:\Cdosmtp.vbs", 1) I have tried to dim hTask as an integer and Long, as well as no designation but I am receiving a Run-time Error 5 on that line.
10
2301
by: A.M | last post by:
Hi, I am having difficulty with shell scripting in Python. I use the following command to run a DOS command and put the return value in a Python variable:
4
2403
by: Anastasios Hatzis | last post by:
I'm looking for a pattern where different client implementations can use the same commands of some fictive tool ("foo") by accessing some kind of API. Actually I have the need for such pattern for my own tool (http://openswarm.sourceforge.net). I already started restructuring my code to separate the actual command implementations from the command-line scripts (which is optparser-based now) and have some ideas how to proceed. But probably...
0
1402
by: leonknathan | last post by:
Hi, I have a batch file that (starts up a shell and) calls a vba program. Is it possible for the vba program to send input back to the shell it was called from (like it's progress)? Is there any way a program called from a shell can return input to that shell? Many Thanks, Leon
0
10701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
12389
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11766
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
11287
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8903
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7042
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
5093
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
4188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.