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.

60 lines
1.6 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright: Microsoft Corp. 1997-1999. All rights reserved
  4. //
  5. /////////////////////////////////////////////////////////////////////////////
  6. // Events.h : Declaration of the CEvents
  7. #ifndef __EVENTS_H_
  8. #define __EVENTS_H_
  9. #include "resource.h" // main symbols
  10. #include "Event.h"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CEvents
  13. class ATL_NO_VTABLE CEvents :
  14. public CComObjectRootEx<CComSingleThreadModel>,
  15. // public CComCoClass<CEvents, &CLSID_Events>,
  16. public ISupportErrorInfo,
  17. public IDispatchImpl<IEvents, &IID_IEvents, &LIBID_EventLogUtilities>
  18. {
  19. private:
  20. unsigned long m_Count;
  21. CComVariant* m_pVector;
  22. HANDLE m_hLog;
  23. public:
  24. CEvents() : m_Count(0), m_pVector(NULL), m_hLog(NULL)
  25. {
  26. }
  27. ~CEvents()
  28. {
  29. if (m_pVector) delete [] m_pVector;
  30. }
  31. // Internal functions
  32. HRESULT Init(HANDLE hLog, const LPCTSTR szEventLogName); // requires a vaild Log handle to be set
  33. DECLARE_REGISTRY_RESOURCEID(IDR_EVENTS)
  34. DECLARE_NOT_AGGREGATABLE(CEvents)
  35. DECLARE_PROTECT_FINAL_CONSTRUCT()
  36. BEGIN_COM_MAP(CEvents)
  37. COM_INTERFACE_ENTRY(IEvents)
  38. COM_INTERFACE_ENTRY(IDispatch)
  39. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  40. END_COM_MAP()
  41. // ISupportsErrorInfo
  42. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  43. // IEvents
  44. STDMETHOD(get_Item)(/*[in]*/ long Index, /*[out, retval]*/ VARIANT *pVal);
  45. STDMETHOD(get__NewEnum)(/*[out, retval]*/ LPUNKNOWN *pVal);
  46. STDMETHOD(get_Count)(/*[out, retval]*/ long *pVal);
  47. };
  48. #endif //__EVENTS_H_