关干定时提醒的有关问题,帮忙
关干定时提醒的问题,帮忙啊
void CShutdownDlg::OnTimer(UINT nIDEvent)
{
CString str1;
if(ftime==TRUE)
{
if((st.wMinute-starttime)%settime==0)
{
ftime=FALSE;
AfxMessageBox( "hello ");
}
}
if(st.wMinute!=currenttime) ftime=TRUE;
CDialog::OnTimer(nIDEvent);
}
开始提醒starttime
间隔时间settime
初始ftime=FALSE
到时间后没有反应,哪里错了
------解决方案--------------------
第一个问题是if(st.wMinute!=currenttime)不为真。
第二个问题 在AfxMessageBox( "wminute ");之前KillTimer,之后SetTimer
void CShutdownDlg::OnTimer(UINT nIDEvent)
{
CString str1;
if(ftime==TRUE)
{
if((st.wMinute-starttime)%settime==0)
{
ftime=FALSE;
AfxMessageBox( "hello ");
}
}
if(st.wMinute!=currenttime) ftime=TRUE;
CDialog::OnTimer(nIDEvent);
}
开始提醒starttime
间隔时间settime
初始ftime=FALSE
到时间后没有反应,哪里错了
------解决方案--------------------
第一个问题是if(st.wMinute!=currenttime)不为真。
第二个问题 在AfxMessageBox( "wminute ");之前KillTimer,之后SetTimer