Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
5.0 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ExtObj.h
  7. //
  8. // Description:
  9. // Definition of the CExtObject class, which implements the
  10. // extension interfaces required by a Microsoft Windows NT Cluster
  11. // Administrator Extension DLL.
  12. //
  13. // Implementation File:
  14. // ExtObj.cpp
  15. //
  16. // Maintained By:
  17. // David Potter (DavidP) Mmmm DD, 1997
  18. //
  19. // Revision History:
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _EXTOBJ_H_
  25. #define _EXTOBJ_H_
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. /////////////////////////////////////////////////////////////////////////////
  29. #ifndef __cluadmex_h__
  30. #include <CluAdmEx.h> // for CLUADMEX_OBJECT_TYPE and interfaces
  31. #endif
  32. #ifndef __extobj_idl_h__
  33. #include "ExtObjID.h" // for CLSID_CoDebugEx
  34. #endif
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Forward Class Declarations
  37. /////////////////////////////////////////////////////////////////////////////
  38. class CExtObject;
  39. class CObjData;
  40. class CResData;
  41. /////////////////////////////////////////////////////////////////////////////
  42. // External Class Declarations
  43. /////////////////////////////////////////////////////////////////////////////
  44. class CBasePropertyPage;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CPageList
  47. /////////////////////////////////////////////////////////////////////////////
  48. typedef CList<CBasePropertyPage *, CBasePropertyPage *> CPageList;
  49. /////////////////////////////////////////////////////////////////////////////
  50. // class CObjData
  51. /////////////////////////////////////////////////////////////////////////////
  52. class CObjData
  53. {
  54. public:
  55. CString m_strName;
  56. CLUADMEX_OBJECT_TYPE m_cot;
  57. virtual ~CObjData(void) { }
  58. }; //*** class CObjData
  59. /////////////////////////////////////////////////////////////////////////////
  60. // class CResData
  61. /////////////////////////////////////////////////////////////////////////////
  62. class CResData : public CObjData
  63. {
  64. public:
  65. HRESOURCE m_hresource;
  66. CString m_strResTypeName;
  67. }; //*** class CResData
  68. /////////////////////////////////////////////////////////////////////////////
  69. // class CExtObject
  70. /////////////////////////////////////////////////////////////////////////////
  71. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  72. //references as template arguments.
  73. class CExtObject :
  74. public IWEExtendPropertySheet,
  75. public ISupportErrorInfo,
  76. public CComObjectRoot,
  77. public CComCoClass<CExtObject, &CLSID_CoDebugEx>
  78. {
  79. public:
  80. CExtObject(void);
  81. BEGIN_COM_MAP(CExtObject)
  82. COM_INTERFACE_ENTRY(IWEExtendPropertySheet)
  83. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  84. END_COM_MAP()
  85. //DECLARE_NOT_AGGREGATABLE(CExtObject)
  86. // Remove the comment from the line above if you don't want your object to
  87. // support aggregation. The default is to support it
  88. DECLARE_REGISTRY(CExtObject, _T("CLUADMEX.DebugEx"), _T("CLUADMEX.DebugEx"), IDS_CLUADMEX_COMOBJ_DESC, THREADFLAGS_APARTMENT)
  89. // ISupportsErrorInfo
  90. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  91. // IWEExtendPropertySheet
  92. public:
  93. STDMETHOD(CreatePropertySheetPages)(
  94. IN IUnknown * piData,
  95. IN IWCPropertySheetCallback * piCallback
  96. );
  97. // Attributes
  98. protected:
  99. IUnknown * m_piData;
  100. BOOL m_bWizard;
  101. DWORD m_istrResTypeName;
  102. // IGetClusterUIInfo data
  103. LCID m_lcid;
  104. HFONT m_hfont;
  105. HICON m_hicon;
  106. // IGetClusterDataInfo data
  107. HCLUSTER m_hcluster;
  108. LONG m_cobj;
  109. CObjData * m_podObjData;
  110. CObjData * PodObjDataRW(void) const { return m_podObjData; }
  111. CResData * PrdResDataRW(void) const { return (CResData *) m_podObjData; }
  112. public:
  113. IUnknown * PiData(void) const { return m_piData; }
  114. BOOL BWizard(void) const { return m_bWizard; }
  115. DWORD IstrResTypeName(void) const { return m_istrResTypeName; }
  116. // IGetClusterUIInfo data
  117. LCID Lcid(void) const { return m_lcid; }
  118. HFONT Hfont(void) const { return m_hfont; }
  119. HICON Hicon(void) const { return m_hicon; }
  120. // IGetClusterDataInfo data
  121. HCLUSTER Hcluster(void) const { return m_hcluster; }
  122. LONG Cobj(void) const { return m_cobj; }
  123. const CObjData * PodObjData(void) const { return m_podObjData; }
  124. const CResData * PrdResData(void) const { return (CResData *) m_podObjData; }
  125. CLUADMEX_OBJECT_TYPE Cot(void) const { ASSERT(PodObjData() != NULL); return PodObjData()->m_cot; }
  126. HRESULT HrGetUIInfo(IUnknown * piData);
  127. HRESULT HrSaveData(IUnknown * piData);
  128. HRESULT HrGetObjectInfo(void);
  129. HRESULT HrGetObjectName(IN OUT IGetClusterObjectInfo * pi);
  130. HRESULT HrGetResourceTypeName(IN OUT IGetClusterResourceInfo * pi);
  131. // Implementation
  132. protected:
  133. virtual ~CExtObject(void);
  134. CPageList m_lpg;
  135. CPageList & Lpg(void) { return m_lpg; }
  136. }; //*** class CExtObject
  137. /////////////////////////////////////////////////////////////////////////////
  138. #endif // _EXTOBJ_H_