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.

69 lines
1.6 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright: Microsoft Corp. 1997-1999. All rights reserved
  4. //
  5. /////////////////////////////////////////////////////////////////////////////
  6. // View.h : Declaration of the CView
  7. #ifndef __VIEW_H_
  8. #define __VIEW_H_
  9. #include "resource.h" // main symbols
  10. #include "Logs.h"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CView
  13. class ATL_NO_VTABLE CView :
  14. public CComObjectRootEx<CComSingleThreadModel>,
  15. public CComCoClass<CView, &CLSID_View>,
  16. public ISupportErrorInfo,
  17. public IDispatchImpl<IView, &IID_IView, &LIBID_EventLogUtilities>
  18. {
  19. private:
  20. CComObject<CLogs>* m_pLogs;
  21. _bstr_t m_ServerName;
  22. public:
  23. CView()
  24. {
  25. /*
  26. // Don't know if I want to set ServerName initially
  27. char* lpBuffer;
  28. DWORD BufferLength;
  29. const unsigned int MaxComputerNameLength = 32;
  30. lpBuffer = new char[MaxComputerNameLength];
  31. BufferLength = GetEnvironmentVariable("COMPUTERNAME", lpBuffer, MaxComputerNameLength);
  32. m_ServerName = lpBuffer;
  33. */
  34. m_pLogs = new CComObject<CLogs>;
  35. m_pLogs->AddRef();
  36. // m_pLogs->Init();
  37. }
  38. ~CView()
  39. {
  40. if (m_pLogs) m_pLogs->Release();
  41. }
  42. DECLARE_REGISTRY_RESOURCEID(IDR_VIEW)
  43. DECLARE_PROTECT_FINAL_CONSTRUCT()
  44. BEGIN_COM_MAP(CView)
  45. COM_INTERFACE_ENTRY(IView)
  46. COM_INTERFACE_ENTRY(IDispatch)
  47. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  48. END_COM_MAP()
  49. // ISupportsErrorInfo
  50. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  51. // IView
  52. STDMETHOD(get_Server)(/*[out, retval]*/ BSTR *pVal);
  53. STDMETHOD(put_Server)(/*[in]*/ BSTR newVal);
  54. STDMETHOD(get_Logs)(/*[out, retval]*/ VARIANT *pVal);
  55. };
  56. #endif //__VIEW_H_