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.

100 lines
2.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: mmclpi.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // MMCTask.cpp : Implementation of CMMCTask
  11. #include "stdafx.h"
  12. #include "cic.h"
  13. #include "MMClpi.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CMMCListPad
  16. CMMCListPadInfo::CMMCListPadInfo()
  17. {
  18. m_bstrTitle =
  19. m_bstrClsid =
  20. m_bstrText = NULL;
  21. m_lNotifyID = 0;
  22. m_bHasButton = FALSE;
  23. }
  24. CMMCListPadInfo::~CMMCListPadInfo()
  25. {
  26. if (m_bstrTitle) SysFreeString (m_bstrTitle);
  27. if (m_bstrText) SysFreeString (m_bstrText);
  28. if (m_bstrClsid) SysFreeString (m_bstrClsid);
  29. }
  30. STDMETHODIMP CMMCListPadInfo::get_Title(BSTR * pVal)
  31. {
  32. if (m_bstrTitle)
  33. *pVal = SysAllocString ((OLECHAR *)m_bstrTitle);
  34. return S_OK;
  35. }
  36. STDMETHODIMP CMMCListPadInfo::get_Text(BSTR * pVal)
  37. {
  38. if (m_bstrText)
  39. *pVal = SysAllocString ((const OLECHAR *)m_bstrText);
  40. return S_OK;
  41. }
  42. STDMETHODIMP CMMCListPadInfo::get_NotifyID(LONG_PTR * pVal)
  43. {
  44. *pVal = m_lNotifyID;
  45. return S_OK;
  46. }
  47. STDMETHODIMP CMMCListPadInfo::get_Clsid(BSTR * pVal)
  48. {
  49. if (m_bstrClsid)
  50. *pVal = SysAllocString ((const OLECHAR *)m_bstrClsid);
  51. return S_OK;
  52. }
  53. STDMETHODIMP CMMCListPadInfo::get_HasButton(BOOL* pVal)
  54. {
  55. *pVal = m_bHasButton;
  56. return S_OK;
  57. }
  58. HRESULT CMMCListPadInfo::SetNotifyID(LONG_PTR nID)
  59. {
  60. m_lNotifyID = nID;
  61. return S_OK;
  62. }
  63. HRESULT CMMCListPadInfo::SetTitle (LPOLESTR szTitle)
  64. {
  65. if (m_bstrTitle) SysFreeString (m_bstrTitle);
  66. m_bstrTitle = SysAllocString (szTitle);
  67. if (!m_bstrTitle)
  68. return E_OUTOFMEMORY;
  69. return S_OK;
  70. }
  71. HRESULT CMMCListPadInfo::SetText (LPOLESTR szText)
  72. {
  73. if (m_bstrText) SysFreeString (m_bstrText);
  74. m_bstrText = SysAllocString (szText);
  75. if (!m_bstrText)
  76. return E_OUTOFMEMORY;
  77. return S_OK;
  78. }
  79. HRESULT CMMCListPadInfo::SetClsid(LPOLESTR szClsid)
  80. {
  81. if (m_bstrClsid) SysFreeString (m_bstrClsid);
  82. m_bstrClsid = SysAllocString (szClsid);
  83. if (!m_bstrClsid)
  84. return E_OUTOFMEMORY;
  85. return S_OK;
  86. }
  87. HRESULT CMMCListPadInfo::SetHasButton (BOOL b)
  88. {
  89. m_bHasButton = b;
  90. return S_OK;
  91. }