#pragma once // MFCCOMControlCtrl.h : Declaration of the CMFCCOMControlCtrl ActiveX Control class. // CMFCCOMControlCtrl : See MFCCOMControlCtrl.cpp for implementation. class CMFCCOMControlCtrl : public COleControl { DECLARE_DYNCREATE(CMFCCOMControlCtrl) // Constructor public: CMFCCOMControlCtrl(); // Overrides public: virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid); virtual void DoPropExchange(CPropExchange* pPX); virtual void OnResetState(); // Implementation protected: ~CMFCCOMControlCtrl(); DECLARE_OLECREATE_EX(CMFCCOMControlCtrl) // Class factory and guid DECLARE_OLETYPELIB(CMFCCOMControlCtrl) // GetTypeInfo DECLARE_PROPPAGEIDS(CMFCCOMControlCtrl) // Property page IDs DECLARE_OLECTLTYPE(CMFCCOMControlCtrl) // Type name and misc status // Message maps DECLARE_MESSAGE_MAP() afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); // Dispatch maps afx_msg BSTR GetLabel(); afx_msg void SetLabel(LPCTSTR lpszNewValue); DECLARE_DISPATCH_MAP() afx_msg void AboutBox(); // Event maps DECLARE_EVENT_MAP() // Dispatch and event IDs public: enum { dispidLabel = 1L, }; void UpdateLabel(LPCTSTR lpszText); private: CString m_label; virtual void OnFontChanged(); virtual void OnBackColorChanged(); virtual void OnForeColorChanged(); };