Solved

VC++, nice way to show that an intern calculation is in progress.

Posted on 1998-09-01
7
255 Views
Last Modified: 2012-05-05
I made a VC++ application that displays some calculations results, these calculations can take 4 or 5 seconds and I would like to use something different than the progress control to make the user waiting.
thanks,
m3.
0
Comment
Question by:m3
  • 3
  • 2
  • 2
7 Comments
 
LVL 2

Expert Comment

by:duneram
ID: 1171832
Normally you would display a progress bar  you know the blue rectangle that slowly fills up the edit control?

You can use the CProgressCtrl to accomplish it
0
 
LVL 2

Expert Comment

by:duneram
ID: 1171833
In the old days before the creation of this class, people used to make a Edit control and then slowly select more and more of the text to give the appearance of having the blue bar grow from left to right until it was at the end point.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1171834
Progress Controls are the usual, but as you've indicated you don't want one.  

How about an AVI, you can play these pretty easily using the CAnimateCtrl class, and it won't be too unusual as plenty of other apps play these when busy (e.g. Find Files).

If you pick something really bizarre, expect user confusion or compliants.
0
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.

 

Author Comment

by:m3
ID: 1171835
It doesn't an alternative solution.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1171836
m3 can you explain a bit more about what you want.  Your comment is particularly cryptic to me, as I thought CAnimateCtrl was an alternative.

If you don't like this why not
EITHER
(i) Show the results as they become available
OR
(ii) Update the text in the dialog/status bar with messages indicating what's happening, e.g.
"Adding numbers"
after 1 second this changes to
"Doing Y"
after 1 second this changes to
"Doing Z and totalling"
etc.

0
 

Author Comment

by:m3
ID: 1171837
I'm intersted in that control, do you have any example of how can I use this control?
Thanks,
m3.
0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 10 total points
ID: 1171838
OK, steps :

1. First get your AVI file.  Needs to be small 16 color, looping and fit within the other limitations of the control (these are documented in the MS Dev help).

2. Add an "AVI" resource
i. Right click on the resource pane in Dev Studio
ii. Click Import menu
iii. Browse the file name and press Import button
iv. Select a resource type of "AVI".
You should now have a folder in your resource tree called "AVI" with an item under it labelled something like IDR_AVI1.  When you click on this item you have loads of hex (don't worry this is binary-ized version of the AVI contents).

3. Code, I'll give an example for sticking one on a dialog box
i. Bring up the dialog you want to add it to
ii. Click the Animate icon on the dialog controls toolbar (looks live a little bit of a movie film)
iii. Drag out the control where you want it.
iv. Press Ctrl-W to bring up class wizard
v. On member variables tab you'll see the control listed as something like IDC_ANIMATE1
vi. Double click on the name and call it some name like m_animate (of type CAnimateCtrl)
vii. To play the AVI add to the code something like:
    m_animate.Open( IDR_AVI1 ); // open the avi resource.
    m_animate.Play( 0, -1,-1 );//play avi resource.      
First param (0) means play from first frame
Second param (-1) means play to the end
Third param (-1) means keep playing for ever
viii. When you want to stop playing the AVI simply call Stop, example:
m_animate.Stop() ;

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 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

18 Experts available now in Live!

Get 1:1 Help Now