Solved

Progress bar in dialog type window

Posted on 2006-11-12
3
233 Views
Last Modified: 2010-04-24
Hi all,
   I would like to have a progress bar run fromo left to right for a application. I cannot figure out how to link the activex progress bar with the method in which I want to show the progress bar. I would appreciate if someone could help me and tell me the code to link the microsoft activx progress control. Details: -
There is an application where the user selects certain files and wants to view them. there is a button which allows the user to view all files at once openned (appended), which takes time. I would like to have a progress bar which could be incorporated which becomes visible only when the user hits that button.

I would appreciate your help.
Thanks,
Ritesh
0
Comment
Question by:riteshromi
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 125 total points
ID: 17930358
A progress bar (AFAIK) needs to have the 'progress' coming from the appllication.  It won't automatically fill from left to right.

Can you tell how far along the preparation/viewing of the files is in your code?




pseudo code

pBar->SetRange(0, 100);
while(busy)
{
  DOSomething();
  pBar->SetPos(iCurrentPositionInLoop);
}
0
 

Author Comment

by:riteshromi
ID: 17938485
Thanks for the comment ....I got hoe to implement the progress bar when busy. It works good ...THE ONLY CONCERN here is to add a text to the bar a statis text which will be visible only when the progress bar is stepping up. I tried the following

CStatic *Label = new CStatic;
      Label->Create("Processing Please Wait", WS_VISIBLE, CRect(50, 530, 220, 550), this, 0x188);
//additional code here
      Label->DestroyWindow();

this is in the method (onclick of a button)
this does not show the text .....only shows the text when the control comes out of the method.
I would appreciate if you could help me.

Thanks,
Romi
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 17938759
void DoEvents()
{  
      MSG msg;  
      while ( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE ) )
      {  
            ::TranslateMessage(&msg);
            ::DispatchMessage(&msg);
      }
}

usage
CStatic *Label = new CStatic;
     Label->Create("Processing Please Wait", WS_VISIBLE, CRect(50, 530, 220, 550), this, 0x188);

DoEvents();  <<------ try adding this


//additional code here
     Label->DestroyWindow();
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
template declaration 35 135
Windows | Visual C++ | String table Comparison tool | WIndows Exes and DLLs 7 110
Tab order 16 63
Need some help with Microsoft Visual Studio C++ 2003 5 51
The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now