Solved

Progress bar in dialog type window

Posted on 2006-11-12
3
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

615 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