void CMainrDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnTimer(nIDEvent);
CString str;
CTime theTime=CTime::GetCurrentTime();
str.Format("%02d:%02d:%02d",theTime.GetHour(),theTime.GetMinute(),theTime.GetSecond());
SetDlgItemText(IDC_STATIC_TIME,str);
}
提示说明,不支持这个类啊,用c语言的time函数试试
把头文件包含进去