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.

191 lines
5.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996 <company name>
  4. //
  5. // Module Name:
  6. // ExtObj.h
  7. //
  8. // Abstract:
  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. // Author:
  17. // <name> (<e-mail name>) Mmmm DD, 1996
  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_CoSmbSmpEx
  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. HKEY m_hkey;
  58. virtual ~CObjData(void) { }
  59. }; //*** class CObjData
  60. /////////////////////////////////////////////////////////////////////////////
  61. // class CResData
  62. /////////////////////////////////////////////////////////////////////////////
  63. class CResData : public CObjData
  64. {
  65. public:
  66. HRESOURCE m_hresource;
  67. CString m_strResTypeName;
  68. virtual ~CResData(void) { }
  69. }; //*** class CResData
  70. /////////////////////////////////////////////////////////////////////////////
  71. // class CExtObject
  72. /////////////////////////////////////////////////////////////////////////////
  73. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  74. //references as template arguments.
  75. class CExtObject :
  76. public IWEExtendPropertySheet,
  77. public IWEExtendWizard,
  78. public ISupportErrorInfo,
  79. public CComObjectRoot,
  80. public CComCoClass<CExtObject, &CLSID_CoSmbSmpEx>
  81. {
  82. public:
  83. CExtObject(void);
  84. BEGIN_COM_MAP(CExtObject)
  85. COM_INTERFACE_ENTRY(IWEExtendPropertySheet)
  86. COM_INTERFACE_ENTRY(IWEExtendWizard)
  87. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  88. END_COM_MAP()
  89. //DECLARE_NOT_AGGREGATABLE(CExtObject)
  90. // Remove the comment from the line above if you don't want your object to
  91. // support aggregation. The default is to support it
  92. DECLARE_REGISTRY(CExtObject, _T("CLUADMEX.SmbSmpEx"), _T("CLUADMEX.SmbSmpEx"), IDS_CLUADMEX_COMOBJ_DESC, THREADFLAGS_APARTMENT)
  93. // ISupportsErrorInfo
  94. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  95. // IWEExtendPropertySheet
  96. public:
  97. STDMETHOD(CreatePropertySheetPages)(
  98. IN IUnknown * piData,
  99. IN IWCPropertySheetCallback * piCallback
  100. );
  101. // IWEExtendWizard
  102. public:
  103. STDMETHOD(CreateWizardPages)(
  104. IN IUnknown * piData,
  105. IN IWCWizardCallback * piCallback
  106. );
  107. // Attributes
  108. protected:
  109. IUnknown * m_piData;
  110. IWCWizardCallback * m_piWizardCallback;
  111. BOOL m_bWizard;
  112. DWORD m_istrResTypeName;
  113. // IGetClusterUIInfo data
  114. LCID m_lcid;
  115. HFONT m_hfont;
  116. HICON m_hicon;
  117. // IGetClusterDataInfo data
  118. HCLUSTER m_hcluster;
  119. HKEY m_hkeyCluster;
  120. LONG m_cobj;
  121. CObjData * m_podObjData;
  122. CObjData * PodObjDataRW(void) const { return m_podObjData; }
  123. CResData * PrdResDataRW(void) const { return (CResData *) m_podObjData; }
  124. public:
  125. IUnknown * PiData(void) const { return m_piData; }
  126. IWCWizardCallback * PiWizardCallback(void) const { return m_piWizardCallback; }
  127. BOOL BWizard(void) const { return m_bWizard; }
  128. DWORD IstrResTypeName(void) const { return m_istrResTypeName; }
  129. // IGetClusterUIInfo data
  130. LCID Lcid(void) const { return m_lcid; }
  131. HFONT Hfont(void) const { return m_hfont; }
  132. HICON Hicon(void) const { return m_hicon; }
  133. // IGetClusterDataInfo data
  134. HCLUSTER Hcluster(void) const { return m_hcluster; }
  135. HKEY HkeyCluster(void) const { return m_hkeyCluster; }
  136. LONG Cobj(void) const { return m_cobj; }
  137. const CObjData * PodObjData(void) const { return m_podObjData; }
  138. const CResData * PrdResData(void) const { return (CResData *) m_podObjData; }
  139. HRESULT HrGetUIInfo(IUnknown * piData);
  140. HRESULT HrSaveData(IUnknown * piData);
  141. HRESULT HrGetObjectInfo(void);
  142. HRESULT HrGetObjectName(IN OUT IGetClusterObjectInfo * pi);
  143. HRESULT HrGetResourceTypeName(IN OUT IGetClusterResourceInfo * pi);
  144. // Implementation
  145. protected:
  146. virtual ~CExtObject(void);
  147. CPageList m_lpg;
  148. CPageList & Lpg(void) { return m_lpg; }
  149. }; //*** class CExtObject
  150. /////////////////////////////////////////////////////////////////////////////
  151. #endif // _EXTOBJ_H_