not stops Wait Cursor - why?
-
In that code Wait cursor not stops appearing, even EndWaitCursor() callled, (until I move mouse)
CFromview::Method() { BeginWaitCursor(); WORK(); EndWaitCursor(); this->Invalidate(); this->UpdateWindow(); }
Why ? how to correctIs
CFromview::Method()
called frequently?
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
Is
CFromview::Method()
called frequently?
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?
-
In that code Wait cursor not stops appearing, even EndWaitCursor() callled, (until I move mouse)
CFromview::Method() { BeginWaitCursor(); WORK(); EndWaitCursor(); this->Invalidate(); this->UpdateWindow(); }
Why ? how to correct -
If you use MFC, you could use a CWaitCursor object:
CFromview::Method() { { CWaitCursor waitCursor; WORK(); } RedrawWindow(); }
HTH, K.
Silence Means Death Stand On Your Feet Inner Fear Your Worst Enemy
-
It sounds like something else is setting the cursor, then. You could also try to catch WM_SETCURSOR, and use a boolean set to true when your application is working:
BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if(m_bMyAppIsWorking){ ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); return TRUE; } ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); return CView::OnSetCursor(pWnd, nHitTest, message); }
Silence Means Death Stand On Your Feet Inner Fear Your Worst Enemy
-
It sounds like something else is setting the cursor, then. You could also try to catch WM_SETCURSOR, and use a boolean set to true when your application is working:
BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if(m_bMyAppIsWorking){ ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT)); return TRUE; } ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); return CView::OnSetCursor(pWnd, nHitTest, message); }
Silence Means Death Stand On Your Feet Inner Fear Your Worst Enemy
-
Please explain what nature of error that was happen? First is need to understand fully, than to solve by try and error.
In the example I gave, the processing of WM_SETCURSOR by the view leads to set the cursor either at IDC_WAIT or at IDC_CROSS, whatever another part of your code set the waitCursor. vgrigor wrote: First is need to understand fully, than to solve by try and error IMHO, not always, sometimes it doesn't worth the time to learn it.
Silence Means Death Stand On Your Feet Inner Fear Your Worst Enemy
-
In that code Wait cursor not stops appearing, even EndWaitCursor() callled, (until I move mouse)
CFromview::Method() { BeginWaitCursor(); WORK(); EndWaitCursor(); this->Invalidate(); this->UpdateWindow(); }
Why ? how to correctEnsure that in your WORK() method nothing is trying to steal the capture of the mouse. Check for SetCapture() API calls.
-
In the example I gave, the processing of WM_SETCURSOR by the view leads to set the cursor either at IDC_WAIT or at IDC_CROSS, whatever another part of your code set the waitCursor. vgrigor wrote: First is need to understand fully, than to solve by try and error IMHO, not always, sometimes it doesn't worth the time to learn it.
Silence Means Death Stand On Your Feet Inner Fear Your Worst Enemy