home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Building OCXs
/
Building_OCXs_Que_1995.iso
/
code
/
ch10
/
timerctl.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-12-14
|
2KB
|
88 lines
// timerctl.h : Declaration of the CTimerCtrl OLE control class.
/////////////////////////////////////////////////////////////////////////////
// CTimerCtrl : See timerctl.cpp for implementation.
const DEFAULT_INTERVAL = 1000;
class CTimerCtrl : public COleControl
{
DECLARE_DYNCREATE(CTimerCtrl)
// Constructor
public:
CTimerCtrl();
// Overrides
// Drawing function
virtual void OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
// Persistence
virtual void DoPropExchange(CPropExchange* pPX);
// Reset control state
virtual void OnResetState();
virtual void OnAmbientPropertyChange(DISPID dispid);
virtual void OnEnabledChanged();
// Implementation
protected:
~CTimerCtrl();
BEGIN_OLEFACTORY(CTimerCtrl) // Class factory and guid
virtual BOOL VerifyUserLicense();
virtual BOOL GetLicenseKey(DWORD, BSTR FAR*);
END_OLEFACTORY(CTimerCtrl)
DECLARE_OLETYPELIB(CTimerCtrl) // GetTypeInfo
DECLARE_PROPPAGEIDS(CTimerCtrl) // Property page IDs
DECLARE_OLECTLTYPE(CTimerCtrl) // Type name and misc status
// Message maps
//{{AFX_MSG(CTimerCtrl)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// Dispatch maps
//{{AFX_DISPATCH(CTimerCtrl)
short m_interval;
afx_msg void OnIntervalChanged();
//}}AFX_DISPATCH
DECLARE_DISPATCH_MAP()
afx_msg void AboutBox();
// Event maps
//{{AFX_EVENT(CTimerCtrl)
void FireTimer()
{FireEvent(eventidTimer,EVENT_PARAM(VTS_NONE));}
//}}AFX_EVENT
DECLARE_EVENT_MAP()
// Dispatch and event IDs
public:
enum {
//{{AFX_DISP_ID(CTimerCtrl)
dispidInterval = 1L,
eventidTimer = 1L,
//}}AFX_DISP_ID
};
protected:
void OnSetClientSite();
void StartTimer();
void StopTimer();
};