Leaked source code of windows server 2003
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.

124 lines
4.6 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to existing Microsoft documentation.
  4. //
  5. //
  6. //
  7. //
  8. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  9. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  10. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  11. // PURPOSE.
  12. //
  13. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  14. //
  15. //
  16. //
  17. //==============================================================;
  18. #ifndef _SAMPCOMP_H_
  19. #define _SAMPCOMP_H_
  20. #include <mmc.h>
  21. #include <tchar.h>
  22. #include "EnumTASK.h"
  23. #include "globals.h"
  24. class CComponent : public IComponent,
  25. IExtendTaskPad
  26. {
  27. private:
  28. ULONG m_cref;
  29. IConsole* m_ipConsole;
  30. IConsole2* m_ipConsole2;
  31. //store the view type: standard or taskpad
  32. BOOL m_bTaskpadView;
  33. //store the user's view type preference.
  34. BOOL m_bIsTaskpadPreferred;
  35. class CComponentData *m_pComponentData;
  36. public:
  37. CComponent(CComponentData *parent);
  38. ~CComponent();
  39. ///////////////////////////////
  40. // Interface IUnknown
  41. ///////////////////////////////
  42. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
  43. STDMETHODIMP_(ULONG) AddRef();
  44. STDMETHODIMP_(ULONG) Release();
  45. ///////////////////////////////
  46. // Interface IComponent
  47. ///////////////////////////////
  48. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
  49. /* [in] */ LPCONSOLE lpConsole);
  50. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
  51. /* [in] */ LPDATAOBJECT lpDataObject,
  52. /* [in] */ MMC_NOTIFY_TYPE event,
  53. /* [in] */ LPARAM arg,
  54. /* [in] */ LPARAM param);
  55. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy(
  56. /* [in] */ MMC_COOKIE cookie);
  57. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
  58. /* [in] */ MMC_COOKIE cookie,
  59. /* [in] */ DATA_OBJECT_TYPES type,
  60. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
  61. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetResultViewType(
  62. /* [in] */ MMC_COOKIE cookie,
  63. /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
  64. /* [out] */ long __RPC_FAR *pViewOptions);
  65. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
  66. /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
  67. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
  68. /* [in] */ LPDATAOBJECT lpDataObjectA,
  69. /* [in] */ LPDATAOBJECT lpDataObjectB);
  70. ///////////////////////////////
  71. // Interface IComponent
  72. ///////////////////////////////
  73. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TaskNotify(
  74. /* [in] */ IDataObject __RPC_FAR *pdo,
  75. /* [in] */ VARIANT __RPC_FAR *arg,
  76. /* [in] */ VARIANT __RPC_FAR *param);
  77. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumTasks(
  78. /* [in] */ IDataObject __RPC_FAR *pdo,
  79. /* [string][in] */ LPOLESTR szTaskGroup,
  80. /* [out] */ IEnumTASK __RPC_FAR *__RPC_FAR *ppEnumTASK);
  81. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetTitle(
  82. /* [string][in] */ LPOLESTR pszGroup,
  83. /* [string][out] */ LPOLESTR __RPC_FAR *pszTitle);
  84. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDescriptiveText(
  85. /* [string][in] */ LPOLESTR pszGroup,
  86. /* [string][out] */ LPOLESTR __RPC_FAR *pszDescriptiveText);
  87. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetBackground(
  88. /* [string][in] */ LPOLESTR pszGroup,
  89. /* [out] */ MMC_TASK_DISPLAY_OBJECT __RPC_FAR *pTDO);
  90. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetListPadInfo(
  91. /* [string][in] */ LPOLESTR pszGroup,
  92. /* [out] */ MMC_LISTPAD_INFO __RPC_FAR *lpListPadInfo);
  93. private:
  94. LPOLESTR OleDuplicateString(LPOLESTR lpStr) {
  95. LPOLESTR tmp = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(lpStr) + 1) * sizeof(WCHAR)));
  96. wcscpy(tmp, lpStr);
  97. return tmp;
  98. }
  99. };
  100. #endif _SAMPCOMP_H_