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.

72 lines
1.8 KiB

  1. /*
  2. * snapinabout.hxx
  3. *
  4. *
  5. * Copyright (c) 1998-1999 Microsoft Corporation
  6. *
  7. * PURPOSE: Defines the Csnapinabout class template.
  8. *
  9. *
  10. * OWNER: ptousig
  11. */
  12. // snapinabout.h: Definition of the Csnapinabout class
  13. //
  14. //////////////////////////////////////////////////////////////////////
  15. #pragma once
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CSnapinAbout
  18. class CSnapinAbout : public ISnapinAbout,
  19. public CComObjectRoot
  20. {
  21. public:
  22. CSnapinAbout(CBaseSnapin *psnapin);
  23. virtual ~CSnapinAbout(void);
  24. public:
  25. // Snapin registry functions.
  26. static HRESULT WINAPI UpdateRegistry(BOOL fRegister) { return S_OK;} // needed by ATL
  27. inline CBaseSnapin * Psnapin(void) { return m_psnapin;}
  28. inline const tstring& StrSnapinClassName(void) { return Psnapin()->StrClassName();}
  29. public:
  30. //
  31. // ISnapinAbout interface
  32. //
  33. STDMETHOD(GetSnapinDescription)(LPOLESTR *lpDescription);
  34. STDMETHOD(GetProvider)(LPOLESTR * lpName);
  35. STDMETHOD(GetSnapinVersion)(LPOLESTR *lpVersion);
  36. STDMETHOD(GetSnapinImage)(HICON *phAppIcon);
  37. STDMETHOD(GetStaticFolderImage)(HBITMAP * hSmallImage, HBITMAP * hSmallImageOpen, HBITMAP * hLargeImage, COLORREF *cMask);
  38. private:
  39. CBaseSnapin *m_psnapin;
  40. };
  41. template <class TSnapin, const CLSID* pclsid>
  42. class CSnapinAboutTemplate : public CSnapinAbout,
  43. public CComCoClass< CSnapinAboutTemplate<TSnapin, pclsid>, pclsid >
  44. {
  45. typedef CSnapinAboutTemplate<TSnapin, pclsid> t_self;
  46. BEGIN_COM_MAP(t_self)
  47. COM_INTERFACE_ENTRY(ISnapinAbout)
  48. END_COM_MAP()
  49. DECLARE_NOT_AGGREGATABLE(t_self);
  50. public:
  51. CSnapinAboutTemplate(void)
  52. : CSnapinAbout(&TSnapin::s_snapin)
  53. {
  54. }
  55. virtual ~CSnapinAboutTemplate(void)
  56. {
  57. }
  58. };