home *** CD-ROM | disk | FTP | other *** search
/ Building OCXs / Building_OCXs_Que_1995.iso / code / ch04 / quotectl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-17  |  1.6 KB  |  68 lines

  1. // quotectl.h : Declaration of the CQuoteCtrl OLE control class.
  2.  
  3. #define MAXQUOTES     6
  4. /////////////////////////////////////////////////////////////////////////////
  5. // CQuoteCtrl : See quotectl.cpp for implementation.
  6. //
  7. class CQuoteCtrl : public COleControl
  8. {
  9.     DECLARE_DYNCREATE(CQuoteCtrl)
  10.  
  11. // Constructor
  12. public:
  13.     CQuoteCtrl();
  14.  
  15.     // Drawing function
  16.     virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  17.  
  18.     // Persistence
  19.     virtual void DoPropExchange(CPropExchange* pPX);
  20.  
  21.     // Reset control state
  22.     virtual void OnResetState();
  23.  
  24.     BSTR m_bstrQuote[MAXQUOTES];
  25.     BSTR m_bstrAuthor[MAXQUOTES];
  26.     int m_nQID;
  27. // Implementation
  28. protected:
  29.     ~CQuoteCtrl();
  30.  
  31.     BEGIN_OLEFACTORY(CQuoteCtrl)        // Class factory and guid
  32.         virtual BOOL VerifyUserLicense();
  33.         virtual BOOL GetLicenseKey(DWORD, BSTR FAR*);
  34.     END_OLEFACTORY(CQuoteCtrl)
  35.  
  36.     DECLARE_OLETYPELIB(CQuoteCtrl)      // GetTypeInfo
  37.     DECLARE_PROPPAGEIDS(CQuoteCtrl)     // Property page IDs
  38.     DECLARE_OLECTLTYPE(CQuoteCtrl)        // Type name and misc status
  39.  
  40.     // Message maps
  41.     //{{AFX_MSG(CQuoteCtrl)
  42.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  43.     //}}AFX_MSG
  44.     DECLARE_MESSAGE_MAP()
  45.  
  46.     // Dispatch maps
  47.     //{{AFX_DISPATCH(CQuoteCtrl)
  48.     BOOL m_showAuthor;
  49.     afx_msg void OnShowAuthorChanged();
  50.     //}}AFX_DISPATCH
  51.     DECLARE_DISPATCH_MAP()
  52.  
  53.     afx_msg void AboutBox();
  54.  
  55.     // Event maps
  56.     //{{AFX_EVENT(CQuoteCtrl)
  57.     //}}AFX_EVENT
  58.     DECLARE_EVENT_MAP()
  59.  
  60. // Dispatch and event IDs
  61. public:
  62.     enum {
  63.     //{{AFX_DISP_ID(CQuoteCtrl)
  64.     dispidShowAuthor = 1L,
  65.     //}}AFX_DISP_ID
  66.     };
  67. };
  68.