首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VC >

线程操作,该如何解决

2013-08-01 
线程操作CWinThread* mythread AfxBeginThread(Refresh,THREAD_PRIORITY_NORMAL,0,0,NULL)void Demo::R

线程操作
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);

热点排行