CMainFrame* pMF=(CMainFrame*)AfxGetApp()->m_pMainWnd; //先通过获取当前框架指针
CView * active = pMF->GetActiveView();//才能获取当前视类指针
if(active != NULL) //获取了当前视类指针才能发送消息::SetTimer(pDlg- >m_hWnd,1,5
::SetTimer(active->m_hWnd,1,30000,NULL);
CMainFrame* pMF=(CMainFrame*)AfxGetApp()->m_pMainWnd; //先通过获取当前框架指针
CView * active = pMF->GetActiveView();//才能获取当前视类指针
if(active != NULL) //获取了当前视类指针才能发送消息 ::KillTimer(active->m_hWnd,1); //启动Timer
时间也可以用变量表示 int stime=30000;
::SetTimer(active->m_hWnd,1,stime,NULL);