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.

82 lines
1.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright: Microsoft Corp. 1997-1999. All rights reserved
  4. //
  5. /////////////////////////////////////////////////////////////////////////////
  6. // View.cpp : Implementation of CView
  7. #include "stdafx.h"
  8. #include "Evntutl.h"
  9. #include "View.h"
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CView
  12. STDMETHODIMP CView::InterfaceSupportsErrorInfo(REFIID riid)
  13. {
  14. static const IID* arr[] =
  15. {
  16. &IID_IView
  17. };
  18. for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
  19. {
  20. if (InlineIsEqualGUID(*arr[i],riid))
  21. return S_OK;
  22. }
  23. return S_FALSE;
  24. }
  25. /*
  26. Function: get_Logs
  27. Inputs: empty variant
  28. Outputs: variant dispatch pointer to an ILogs interface
  29. Purpose: Provide access to ILogs
  30. */
  31. STDMETHODIMP CView::get_Logs(VARIANT *pVal)
  32. {
  33. HRESULT hr = S_OK;
  34. VariantInit(pVal);
  35. IDispatch* pDisp;
  36. hr = m_pLogs->QueryInterface (IID_IDispatch, (void**) &pDisp);
  37. if (SUCCEEDED(hr))
  38. {
  39. pVal->vt = VT_DISPATCH;
  40. pVal->pdispVal = pDisp;
  41. m_pLogs->m_ServerName = m_ServerName.copy();
  42. hr = m_pLogs->Init();
  43. }
  44. return hr;
  45. }
  46. /*
  47. Function: get_Server
  48. Inputs: empty BSTR
  49. Outputs: BSTR containing the current value of the server member variable
  50. Purpose: Allows user to see which Server's EventLog will be displayed
  51. */
  52. STDMETHODIMP CView::get_Server(BSTR *pVal)
  53. {
  54. HRESULT hr = S_OK;
  55. if (pVal) *pVal = m_ServerName.copy();
  56. else hr = E_POINTER;
  57. return hr;
  58. }
  59. /*
  60. Function: put_Server
  61. Inputs: BSTR containing a valid server name
  62. Outputs: none
  63. Purpose: Allows user to set which Server's EventLog will be displayed
  64. */
  65. STDMETHODIMP CView::put_Server(BSTR newVal)
  66. {
  67. m_ServerName = newVal;
  68. m_pLogs->m_ServerName = m_ServerName.copy();
  69. return S_OK;
  70. }