The main thread:
.
AfxBeginThread (f_fun_Thread,);
Sleep (30000);
The child thread:
F_fun_Thread {
M_tree - & gt; GetItemData (hItem); --> Jam, such as the main thread Sleep (30000); Until after running down
}
Then do forward in the main thread, the child thread would have a normal
AfxBeginThread (f_fun_Thread,);
Int count=0;
While (count++ & lt; 60) {
While (: : PeekMessage (& amp; MSG, NULL, 0, 0, PM_REMOVE)) {
: : TranslateMessage (& amp; MSG);
: : DispatchMessage (& amp; MSG);
}
Sleep (500);
}
So the message loop GetItemData need???????
CodePudding user response:
In the main thread m_tree?Sleep (30000); The main thread is not running!
CodePudding user response: