Hi all . could any one help me fix the following errors when using switch.Thanks
Errors:
Code:
--------------------Configuration: timers - Win32 Debug--------------------
Compiling...
timersDlg.cpp
C:\visualC\timers\timersDlg.cpp(219) : error C2065: 'Switch' : undeclared identifier
C:\visualC\timers\timersDlg.cpp(220) : error C2143: syntax error : missing ';' before '{'
C:\visualC\timers\timersDlg.cpp(222) : error C2046: illegal case
C:\visualC\timers\timersDlg.cpp(227) : error C2043: illegal break
C:\visualC\timers\timersDlg.cpp(228) : error C2046: illegal case
C:\visualC\timers\timersDlg.cpp(232) : error C2043: illegal break
Error executing cl.exe.
timers.exe - 6 error(s), 0 warning(s)
visual c++ code:
Code:
void CTimersDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CTime curTime = CTime::GetCurrentTime();
Switch(nIDEvent)
{
case ID_CLOCK_TIMER:
m_sTime.Format("%d:%d:%d",curTime.GetHour(),
curTime.GetMinute(),
curTime.GetSecond());
break;
case ID_COUNT_TIMER:
m_iCount++;
m_sCount.Format("%d", m_iCount);
break;
}
UpdateData(FALSE);
//END OF MY MYCODE
CDialog::OnTimer(nIDEvent);
}