64,685
社区成员
发帖
与我相关
我的任务
分享
void ThreadFunc()
{
CTime time;
CString strTime;
m_bRun=TRUE;
while(m_bRun)
{
time=CTime::GetCurrentTime();
strTime=time.Format("%H:%M:%S");
::SetDlgItemText(AfxGetApp()->GetMainWnd()->m_hWnd,IDC_EDIT1,strTime);
//::SetDlgItemText(AfxgetMainWnd()->m_pMainWnd->m_hWnd,IDC_EDIT1,strTime);可以
//::SetDlgItemText(AfxGetMainWnd()->m_hWnd,IDC_EDIT1,strTime);不可以
Sleep(1000);
}
}