class CMyDialogDlg : public CDialog { ... afx_msg void OnTimer(UINT nIDEvent); ... }In the .cpp file add:
BEGIN_MESSAGE_MAP(CMyDialogDlg, CDialog) ... ON_WM_TIMER() ... END_MESSAGE_MAP() ... void CMyDialog::OnTimer(UINT id) { // ... Do what you want here... CDialog::OnTimer(id); }