PropPageCtrl.h
上传用户:lc8096
上传日期:2007-01-02
资源大小:40k
文件大小:3k
源码类别:

ActiveX/DCOM/ATL

开发平台:

Visual C++

  1. // PropPageCtrl.h : Declaration of the CPropPageCtrl
  2. #ifndef __PROPPAGECTRL_H_
  3. #define __PROPPAGECTRL_H_
  4. #include "resource.h"       // main symbols
  5. #include "CPPropPageATL.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CPropPageCtrl
  8. class ATL_NO_VTABLE CPropPageCtrl : 
  9. public CComObjectRootEx<CComSingleThreadModel>,
  10. public CComCoClass<CPropPageCtrl, &CLSID_PropPageCtrl>,
  11. public CComControl<CPropPageCtrl>,
  12. public IDispatchImpl<IPropPageCtrl, &IID_IPropPageCtrl, &LIBID_PROPPAGEATLLib>,
  13. public IProvideClassInfo2Impl<&CLSID_PropPageCtrl, &DIID__DPropPageCtrlEvents, &LIBID_PROPPAGEATLLib>,
  14. public IPersistStreamInitImpl<CPropPageCtrl>,
  15. public IPersistStorageImpl<CPropPageCtrl>,
  16. public IQuickActivateImpl<CPropPageCtrl>,
  17. public IOleControlImpl<CPropPageCtrl>,
  18. public IOleObjectImpl<CPropPageCtrl>,
  19. public IOleInPlaceActiveObjectImpl<CPropPageCtrl>,
  20. public IViewObjectExImpl<CPropPageCtrl>,
  21. public IOleInPlaceObjectWindowlessImpl<CPropPageCtrl>,
  22. public IDataObjectImpl<CPropPageCtrl>,
  23. public ISpecifyPropertyPagesImpl<CPropPageCtrl>,
  24. public CProxy_DPropPageCtrlEvents<CPropPageCtrl>,
  25. public IConnectionPointContainerImpl<CPropPageCtrl>
  26. {
  27. public:
  28. CPropPageCtrl()
  29. {
  30.  
  31. }
  32. DECLARE_REGISTRY_RESOURCEID(IDR_PROPPAGECTRL)
  33. BEGIN_CONNECTION_POINT_MAP(CPropPageCtrl)
  34.     CONNECTION_POINT_ENTRY(DIID__DPropPageCtrlEvents)
  35. END_CONNECTION_POINT_MAP()
  36. BEGIN_COM_MAP(CPropPageCtrl)
  37. COM_INTERFACE_ENTRY(IPropPageCtrl)
  38. COM_INTERFACE_ENTRY(IDispatch)
  39. COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
  40. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
  41. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
  42. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
  43. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
  44. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
  45. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
  46. COM_INTERFACE_ENTRY_IMPL(IOleControl)
  47. COM_INTERFACE_ENTRY_IMPL(IOleObject)
  48. COM_INTERFACE_ENTRY_IMPL(IQuickActivate)
  49. COM_INTERFACE_ENTRY_IMPL(IPersistStorage)
  50. COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
  51. COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages)
  52. COM_INTERFACE_ENTRY_IMPL(IDataObject)
  53. COM_INTERFACE_ENTRY(IProvideClassInfo)
  54. COM_INTERFACE_ENTRY(IProvideClassInfo2)
  55. COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
  56. END_COM_MAP()
  57. BEGIN_PROPERTY_MAP(CPropPageCtrl)
  58. // Example entries
  59. // PROP_ENTRY("Property Description", dispid, clsid)
  60. PROP_PAGE(CLSID_PropPagePpg)
  61. END_PROPERTY_MAP()
  62. BEGIN_MSG_MAP(CPropPageCtrl)
  63. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  64. MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  65. MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
  66. END_MSG_MAP()
  67. // IViewObjectEx
  68. STDMETHOD(GetViewStatus)(DWORD* pdwStatus)
  69. {
  70. ATLTRACE(_T("IViewObjectExImpl::GetViewStatusn"));
  71. *pdwStatus = VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE;
  72. return S_OK;
  73. }
  74. // IPropPageCtrl
  75. public:
  76. STDMETHOD(Execute)();
  77. HRESULT OnDraw(ATL_DRAWINFO& di);
  78. };
  79. #endif //__PROPPAGECTRL_H_