Solved

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

Posted on 1998-09-01
7
260 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SetCurrentDirectory path limit 7 144
passing data from one form to another form in c++ 27 89
What is sub-make ? 2 88
HTTPSendRequest with WinINet delays on first call 11 81
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

749 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