MFC多线程
void__cdeclThreadFun(LPVOIDlpParam){CTestDlg*p=(CTestDlg*)lpParam;inti=0;while(1){i++;CTimetime=CTime::GetCurrentTime();CStringszTime=time.Format("%H:%M:%S");p->SetWindowText(szTime.GetBuffer(szTime.GetLength()));Sleep(1000);if(i>=50)break;}}voidCTestDlg::OnBnClickedButton7(){_beginthread(ThreadFun,0,this);}
VC2010编译运行
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。