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.

61 lines
1.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////
  2. // Component.h : Declaration of the CComponent
  3. // Copyright (c) Microsoft Corporation 1999.
  4. #ifndef __COMPONENT_H_
  5. #define __COMPONENT_H_
  6. #pragma once
  7. #include <objectwithsiteimplsec.h>
  8. #include "componentimpl.h"
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CComponent
  11. class ATL_NO_VTABLE CComponent :
  12. public CComObjectRootEx<CComMultiThreadModel>,
  13. public CComCoClass<CComponent, &CLSID_Component>,
  14. public IObjectWithSiteImplSec<CComponent>,
  15. public IComponentImpl<CComponent>
  16. {
  17. public:
  18. CComponent() : m_bRequiresSave(false)
  19. {
  20. }
  21. REGISTER_AUTOMATION_OBJECT_WITH_TM(IDS_REG_TUNEROBJ,
  22. IDS_REG_COMPONENT_PROGID,
  23. IDS_REG_COMPONENT_DESC,
  24. LIBID_TunerLib,
  25. CLSID_Component, tvBoth);
  26. DECLARE_PROTECT_FINAL_CONSTRUCT()
  27. BEGIN_COM_MAP(CComponent)
  28. COM_INTERFACE_ENTRY(IComponent)
  29. COM_INTERFACE_ENTRY(IObjectWithSite)
  30. COM_INTERFACE_ENTRY(IPersistPropertyBag)
  31. COM_INTERFACE_ENTRY(IPersist)
  32. COM_INTERFACE_ENTRY(IDispatch)
  33. END_COM_MAP_WITH_FTM()
  34. BEGIN_CATEGORY_MAP(CComponent)
  35. IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
  36. IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
  37. IMPLEMENTED_CATEGORY(CATID_PersistsToPropertyBag)
  38. END_CATEGORY_MAP()
  39. public:
  40. bool m_bRequiresSave;
  41. BEGIN_PROP_MAP(CComponent)
  42. CHAIN_PROP_MAP(IComponentImpl<CComponent>)
  43. END_PROPERTY_MAP()
  44. };
  45. typedef CComQIPtr<IComponent> PQComponent;
  46. #endif //__COMPONENT_H_