void CDahaojiDlg::OnTimer(UINT nlDEvent)
{
if(nlDEvent==2)
{
CTimeSpan time=time2-time1;
strTime1.Format("%2d小时 %2d分 %2d秒",time.GetHours(),time.GetMinutes(),time.GetSeconds());
GetDlgItem(IDC_STATIC29)->SetWindowText(strTime1);
if(strTime1=="0小时0分0秒")
{
KillTimer(2);
SetTimer(21,1000,NULL);
}
}
}
On Timer中运行到GetDlgItem(__IDC__STATIC29)->SetWindowText(strTime1);
时出现Unhandled exception in xxx.exe (MFC42.DLL): 0XC0000005: Access Violation.本人是菜鸟不太懂,请各位大侠帮忙。_