Link to home
Start Free TrialLog in
Avatar of Muhammad-Shakeel
Muhammad-Shakeel

asked on

WAIT Cursor in MFC Application?

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...
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of ghimireniraj
ghimireniraj


   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
CWaitCursor Wait;  // Display cursor
...                // Your procedures
Wait.Restore();    // Restores the original cursor


Regards,
Tim