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.

57 lines
1.4 KiB

  1. // MediaState.h : Declaration of the CMediaState
  2. #ifndef __MEDIASTATE_H_
  3. #define __MEDIASTATE_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CMediaState
  7. class ATL_NO_VTABLE CMediaState :
  8. public CComObjectRootEx<CComMultiThreadModel>,
  9. public CComCoClass<CMediaState, &CLSID_MediaState>,
  10. public ISupportErrorInfo,
  11. public IDispatchImpl<IMediaState, &IID_IMediaState, &LIBID_MSSANICLib>
  12. {
  13. public:
  14. CMediaState()
  15. {
  16. m_pUnkMarshaler = NULL;
  17. }
  18. DECLARE_REGISTRY_RESOURCEID(IDR_MEDIASTATE)
  19. DECLARE_GET_CONTROLLING_UNKNOWN()
  20. DECLARE_PROTECT_FINAL_CONSTRUCT()
  21. BEGIN_COM_MAP(CMediaState)
  22. COM_INTERFACE_ENTRY(IMediaState)
  23. COM_INTERFACE_ENTRY(IDispatch)
  24. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  25. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  26. END_COM_MAP()
  27. HRESULT FinalConstruct()
  28. {
  29. return CoCreateFreeThreadedMarshaler(
  30. GetControllingUnknown(), &m_pUnkMarshaler.p);
  31. }
  32. void FinalRelease()
  33. {
  34. m_pUnkMarshaler.Release();
  35. }
  36. CComPtr<IUnknown> m_pUnkMarshaler;
  37. // ISupportsErrorInfo
  38. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  39. // IMediaState
  40. public:
  41. STDMETHOD(IsConnected)(BSTR bstrGUID, VARIANT_BOOL *pbRet);
  42. };
  43. #endif //__MEDIASTATE_H_