cmbhatt,
Typically when you declare a waitCursor object the cursor will immediately change and then revert back to the normal cursor once the current code scope (as defined by brackets {}) is finished. For example, if you declare it at the beginning of a function, when the function returns, the cursor will automatically be restored to the normal one.
For example:
void myfunc1()
{
// Change to busy cursor with this declaration
waitCursor wc;
// Do something time consuming
// When function returns, the cursor returns to normal
}
However, you can leverage the fact that declaring a waitCursor is scope-dependent. In the example below, I have added a set of brackets to give the waitCursor scope. After the closing bracket, the cursor will return to normal. One caveat with doing this sort of things is that it can complicate variable scoping so you have to be really careful doing it.
void myfunc2()
{
// Add a set of brackets to create scope for the wait cursor.
{
waitCursor wc;
// Do something time consuming in this scope and show waitCursor
}
// Outside of above bracket scope, cursor returns to normal
// Now continue doing other things and cursor will be normal pointer.
}
I hope this helps,
Cheers,
Chris