Solved

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

Posted on 1998-09-01
7
254 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

746 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

9 Experts available now in Live!

Get 1:1 Help Now