jai krishna February 2016

calling Beginwaitcursor function from worker thread in MFC

Can someone help me in understanding the worker threads in VC++(MFC)? Following is my workerthread function

UINT ThreadFunc(LPVOID pParam)
{
// some initialization... etc..

AfxGetApp()->BeginWaitCursor();

...
..
/// some operations

AfxGetApp()->End WaitCursor();

}

Is it okay to call WaitCursor() functions from a worker thread?

Answers


cocarin February 2016

The documentation available for BeginWaitCursor and EndWaitCursor make no mention of issues related to threading.

The one thing that is mentioned,

The actions of BeginWaitCursor are not always effective outside of a single message handler as other actions, such as OnSetCursor handling, could change the cursor.

Other threads can change the cursor as well while your worker thread is working.

Post Status

Asked in February 2016
Viewed 3,233 times
Voted 8
Answered 1 times

Search




Leave an answer