Call the BeginWaitCursor function to start the wait to be cursor, call the endwaitcursor function to the end and wait for the cursor. To pay attention, both must call the members of the app, as shown below:
AFXGetApp () -> beginwaitcursor ();
// What to do
AFXGetApp () -> endwaitcursor ();