#pragma once #include ".\eanbarcode.h" // BarCodeCtrl.h : Declaration of the CBarCodeCtrl ActiveX Control class. // CBarCodeCtrl : See BarCodeCtrl.cpp for implementation. class CBarCodeCtrl : public COleControl { DECLARE_DYNCREATE(CBarCodeCtrl) // Constructor public: CBarCodeCtrl(); // Overrides public: virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid); virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual void DoPropExchange(CPropExchange* pPX); virtual void OnResetState(); // Implementation protected: ~CBarCodeCtrl(); DECLARE_OLECREATE_EX(CBarCodeCtrl) // Class factory and guid DECLARE_OLETYPELIB(CBarCodeCtrl) // GetTypeInfo DECLARE_PROPPAGEIDS(CBarCodeCtrl) // Property page IDs DECLARE_OLECTLTYPE(CBarCodeCtrl) // Type name and misc status // Subclassed control support BOOL IsSubclassedControl(); LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam); // Message maps DECLARE_MESSAGE_MAP() // Dispatch maps DECLARE_DISPATCH_MAP() // Event maps DECLARE_EVENT_MAP() // Dispatch and event IDs public: enum { dispidcc = 2, dispidCode = 1 }; protected: BSTR GetCode(BSTR* code); void SetCode(BSTR* code, LPCTSTR newVal); protected: afx_msg void OnPaint(); virtual void OnTextChanged(); protected: // data CEANBarCode m_Code; };