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.

89 lines
2.6 KiB

  1. /*--------------------------------------------------------------------------*
  2. *
  3. * Microsoft Windows
  4. * Copyright (C) Microsoft Corporation, 1992 - 000
  5. *
  6. * File: viewexttest.h
  7. *
  8. * Contents:
  9. *
  10. * History: 20-Mar-2000 jeffro Created
  11. *
  12. *--------------------------------------------------------------------------*/
  13. #pragma once
  14. #include "Extension.h"
  15. #include "string.h"
  16. class CViewExtension :
  17. public CExtension,
  18. public IExtendView
  19. {
  20. BEGIN_COM_MAP(CViewExtension)
  21. COM_INTERFACE_ENTRY(IExtendView)
  22. END_COM_MAP()
  23. public:
  24. // IExtendView methods
  25. STDMETHOD(GetViews) (IDataObject* pDataObject, IViewExtensionCallback* pViewExtCallback);
  26. virtual const CLSID& GetCLSID() const = 0;
  27. virtual std::wstring GetTabName() const = 0;
  28. virtual std::wstring GetTooltip() const = 0;
  29. virtual UINT GetResourceID() const { return 0; }
  30. virtual std::wstring GetResource() const { return L""; }
  31. private:
  32. };
  33. extern const CLSID CLSID_EventViewExtension1;
  34. class CEventViewExtension1 :
  35. public CViewExtension,
  36. public CComCoClass<CEventViewExtension1, &CLSID_EventViewExtension1>
  37. {
  38. DECLARE_EXTENSION_REGISTRATION(
  39. eExtType_View,
  40. CLSID_EventViewExtension1,
  41. "EventViewExtension1 Class",
  42. "TestSnapins.EventViewExtension1.1",
  43. "TestSnapins.EventViewExtension1",
  44. "{7AB4A1FC-E403-11D0-9A97-00C04FD8DBF7}"); // event viewer nodetype
  45. public:
  46. virtual const CLSID& GetCLSID() const { return (CLSID_EventViewExtension1); }
  47. virtual std::wstring GetTabName() const { return (L"Event Ext 1"); }
  48. virtual std::wstring GetTooltip() const { return (L"Tooltip for Event Ext 1"); }
  49. virtual UINT GetResourceID() const { return (IDR_EventViewExt1); }
  50. virtual std::wstring GetResource() const { return (L"file://d:\\newnt\\admin\\mmcdev\\test\\Snapins\\Sample\\res\\EventViewExt1.htm"); }
  51. };
  52. extern const CLSID CLSID_EventViewExtension2;
  53. class CEventViewExtension2 :
  54. public CViewExtension,
  55. public CComCoClass<CEventViewExtension2, &CLSID_EventViewExtension2>
  56. {
  57. DECLARE_EXTENSION_REGISTRATION(
  58. eExtType_View,
  59. CLSID_EventViewExtension2,
  60. "EventViewExtension2 Class",
  61. "TestSnapins.EventViewExtension2.1",
  62. "TestSnapins.EventViewExtension2",
  63. "{7AB4A1FC-E403-11D0-9A97-00C04FD8DBF7}"); // event viewer nodetype
  64. public:
  65. virtual const CLSID& GetCLSID() const { return (CLSID_EventViewExtension2); }
  66. virtual std::wstring GetTabName() const { return (L"Event Ext 2"); }
  67. virtual std::wstring GetTooltip() const { return (L"Tooltip for Event Ext 2"); }
  68. virtual UINT GetResourceID() const { return (IDR_EventViewExt2); }
  69. virtual std::wstring GetResource() const { return (L"file://d:\\newnt\\admin\\mmcdev\\test\\Snapins\\Sample\\res\\EventViewExt2.htm"); }
  70. };