CWinThread* mythread = AfxBeginThread(Refresh,THREAD_PRIORITY_NORMAL,0,0,NULL);
void Demo::Refresh()
{
((CComboBox*)GetDlgItem(IDC_CMBSTATUS))->AddString("1");//
((CComboBox*)GetDlgItem(IDC_CMBSTATUS))->AddString("2");//
((CComboBox*)GetDlgItem(IDC_CMBSTATUS))->AddString("3");//
((CComboBox*)GetDlgItem(IDC_CMBSTATUS))->AddString("4");//
}
如何调用AfxBeginThread创建线程执行Refresh函数更新窗体上的控件内容
------解决方案--------------------
UINT Refresh_Wnd( LPVOID param )
{
Demo *pOwner = (Demo *)param;
pOwner->Refresh();
return 1;
}
CWinThread* mythread = AfxBeginThread(Refresh_Wnd, this);