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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar Help

Status
Not open for further replies.

NewGuy100

Programmer
Mar 13, 2006
3
0
0
US
I am new to using Visual C++. I used a Control box in the Resource view tab to create the progress bar in the dialog box. This puts all the information in one file. In another file, I want to update the same progress bar so that it looks like it is downloading. How do I do that?
For example:
one file
Progress.cpp:
Member variable,m_pBar, is assigned to Progress Bar that was created by the Control box in the dialog box.

Update.Cpp
I want to update the progress bar in Progress.cpp so that it looks like I am downloading while I am sending information.
 
are you meaning you want the progress bar to step backwards? If so, just subtract an amount from your max value and put that amount in SetPos().

For example:

if your max was 100 and you were stepping by 10's (with 10 iterations)

Code:
int x = 0;
while(whatever = that)
{
  x++;
  m_pBar.SetPos(100-(x*10));
}

BlackDice

 
I actually want to move the progress bar up from another file. The class wizard created a file for me and placed the Progress bar in it. I have another file that wants to use the Progress bar variables to update.

Progress Bar.cpp (created by class wizard)
CFormView type box that allows me to use the progress bar from the control box

Update.cpp
File I created so that I could update the Progress Bar information. In a sense, I want it to increment the Progress bar from in this file. Is this possible and how?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top