BarCodeCtrl.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include ".\eanbarcode.h"
  3. // BarCodeCtrl.h : Declaration of the CBarCodeCtrl ActiveX Control class.
  4. // CBarCodeCtrl : See BarCodeCtrl.cpp for implementation.
  5. class CBarCodeCtrl : public COleControl
  6. {
  7. DECLARE_DYNCREATE(CBarCodeCtrl)
  8. // Constructor
  9. public:
  10. CBarCodeCtrl();
  11. // Overrides
  12. public:
  13. virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  14. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  15. virtual void DoPropExchange(CPropExchange* pPX);
  16. virtual void OnResetState();
  17. // Implementation
  18. protected:
  19. ~CBarCodeCtrl();
  20. DECLARE_OLECREATE_EX(CBarCodeCtrl) // Class factory and guid
  21. DECLARE_OLETYPELIB(CBarCodeCtrl) // GetTypeInfo
  22. DECLARE_PROPPAGEIDS(CBarCodeCtrl) // Property page IDs
  23. DECLARE_OLECTLTYPE(CBarCodeCtrl) // Type name and misc status
  24. // Subclassed control support
  25. BOOL IsSubclassedControl();
  26. LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
  27. // Message maps
  28. DECLARE_MESSAGE_MAP()
  29. // Dispatch maps
  30. DECLARE_DISPATCH_MAP()
  31. // Event maps
  32. DECLARE_EVENT_MAP()
  33. // Dispatch and event IDs
  34. public:
  35. enum {
  36. dispidcc = 2, dispidCode = 1
  37. };
  38. protected:
  39. BSTR GetCode(BSTR* code);
  40. void SetCode(BSTR* code, LPCTSTR newVal);
  41. protected:
  42. afx_msg void OnPaint();
  43. virtual void OnTextChanged();
  44. protected:
  45. // data
  46. CEANBarCode m_Code;
  47. };