Solved

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

Posted on 1998-09-01
7
261 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
[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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

724 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