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.

54 lines
1.4 KiB

  1. // Copyright (c) Microsoft Corporation
  2. // CApartmentThreaded.h : Declaration of the CApartmentThreaded
  3. #ifndef CAPARTMENTTHREADED_H_
  4. #define CAPARTMENTTHREADED_H_
  5. #pragma once
  6. #include "resource.h" // main symbols
  7. #include "sxstest_idl.h"
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CApartmentThreaded
  10. class ATL_NO_VTABLE CApartmentThreaded :
  11. public CComObjectRootEx<CComSingleThreadModel>,
  12. public CComCoClass<CApartmentThreaded, &CLSID_CSxsTest_ApartmentThreaded>,
  13. public ISxsTest_ApartmentThreaded
  14. {
  15. public:
  16. CApartmentThreaded()
  17. {
  18. m_pUnkMarshaler = NULL;
  19. PrintComctl32Path("CApartmentThreaded");
  20. }
  21. DECLARE_REGISTRY_RESOURCEID(IDR_CAPARTMENTTHREADED)
  22. DECLARE_AGGREGATABLE(CApartmentThreaded)
  23. DECLARE_GET_CONTROLLING_UNKNOWN()
  24. DECLARE_PROTECT_FINAL_CONSTRUCT()
  25. BEGIN_COM_MAP(CApartmentThreaded)
  26. COM_INTERFACE_ENTRY(ISxsTest_ApartmentThreaded)
  27. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  28. END_COM_MAP()
  29. HRESULT FinalConstruct()
  30. {
  31. return CoCreateFreeThreadedMarshaler(
  32. GetControllingUnknown(), &m_pUnkMarshaler.p);
  33. }
  34. void FinalRelease()
  35. {
  36. m_pUnkMarshaler.Release();
  37. }
  38. CComPtr<IUnknown> m_pUnkMarshaler;
  39. // ICApartmentThreaded
  40. public:
  41. };
  42. #endif // CAPARTMENTTHREADED_H_