#include"StdAfx.h" #include"CamInfoPage.h" #define VALIDATE_TIME 1000 BEGIN_MESSAGE_MAP(CCamInfoPage, CPropertyPage) //{{AFX_MSG_MAP(CCamInfoPage) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() CCamInfoPage::CCamInfoPage( UINT nIDTemplate, UINT nIDCaption) :CPropertyPage( nIDTemplate, nIDCaption) { VTimerID=nIDTemplate; //+0x1000; VTime=VALIDATE_TIME; CamInfo=NULL; NoUpdate=false; } void CCamInfoPage::Validate() { KillTimer(VTimerID); if(!CamInfo) return; UpdateData(TRUE); DataOut(); NoUpdate=false; } void CCamInfoPage::DelayedValidate() { NoUpdate=true; KillTimer(VTimerID); SetTimer(VTimerID,VTime,NULL); } void CCamInfoPage::Refresh() { if(!CamInfo || NoUpdate) return; DataIn(); UpdateData(FALSE); UpdateControlStates(); } void CCamInfoPage::OnTimer(UINT nIDEvent) { Validate(); CPropertyPage::OnTimer(nIDEvent); }