Solved

WAIT Cursor in MFC Application?

Posted on 2002-06-19
7
1,845 Views
Last Modified: 2013-11-20
Hi everyone...

I am currently working on a critical project and want to display WAIT Cursor in a function.which is using type-library marshalling.

I also connect with a machine on network for accessing information from it.

I have tried every possible option which includes "CWaitCursor", "Begin/EndWaitCursor()",
"GetCapture()","SetCapture()","ReleaseCapture()".

With Best Regards...
0
Comment
Question by:Muhammad-Shakeel
7 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 25 total points
ID: 7092893
Just add a CWaitCursor instance to your function:

void LongFunction () {

CWaitCursor wc;

//...
}
0
 
LVL 32

Assisted Solution

by:jhance
jhance earned 25 total points
ID: 7092897
CWaitCursor
0
 
LVL 5

Expert Comment

by:Jan Louwerens
ID: 7094273
The constructor of the CWaitCursor displays the wait cursor, and the destructor sets it back to normal.

So in jkr's example, the CWaitCursor object is created at the beginning of the function, displaying the wait cursor.
Then, when it's destroyed after leaving the funtion, the normal cursor is displayed again.
0
 
LVL 3

Expert Comment

by:ghimireniraj
ID: 7094817

   BeginWaitCursor(); // display the hourglass cursor

   // do some lengthy processing

   EndWaitCursor(); // remove the hourglass cursor




Aren't these functions working? They belong to CCmdTarget class

--Niraj
0
 
LVL 1

Expert Comment

by:Tim_Musschoot
ID: 7120811
CWaitCursor Wait;  // Display cursor
...                // Your procedures
Wait.Restore();    // Restores the original cursor


Regards,
Tim
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

12 Experts available now in Live!

Get 1:1 Help Now