实用类

////////OnTimer 四步曲

///第一步:在头文件添加---
class CPop3Dlg : public CDialog
{
// Construction
public:
........
afx_msg void OnTimer(UINT nIDEvent);
........
}

///第二步:在文件中添加....
BEGIN_MESSAGE_MAP(CPop3Dlg, CDialog)
{
.........
    ON_WM_TIMER()
.........
}

////第三步:初始化地方添加
BOOL CPop3Dlg::OnInitDialog()
{
.......
    SetTimer(1, 4000, NULL);
.......
}    
    
    
////    函数添加
void CPop3Dlg::OnTimer(UINT nIDEvent)
{
.......
    OnConn();
......    
//    AfxMessageBox("tttttttt");
}

你可能感兴趣的:(实用类)