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.

168 lines
3.7 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. iprpbrws.cpp
  5. Abstract:
  6. Implementation of the IPerPropertyBrowsingg interface exposed on the
  7. Polyline object.
  8. --*/
  9. #include "polyline.h"
  10. #include "unkhlpr.h"
  11. #include "smonid.h"
  12. #include "ctrprop.h"
  13. #include "srcprop.h"
  14. #include "genprop.h"
  15. /*
  16. * CImpIPerPropertyBrowsing interface implementation
  17. */
  18. IMPLEMENT_CONTAINED_INTERFACE(CPolyline, CImpIPerPropertyBrowsing)
  19. /*
  20. * CImpIPerPropertyBrowsing::GetClassID
  21. *
  22. * Purpose:
  23. * Returns the CLSID of the object represented by this interface.
  24. *
  25. * Parameters:
  26. * pClsID LPCLSID in which to store our CLSID.
  27. */
  28. STDMETHODIMP
  29. CImpIPerPropertyBrowsing::GetClassID(LPCLSID pClsID)
  30. {
  31. HRESULT hr = S_OK;
  32. if (pClsID == NULL) {
  33. return E_POINTER;
  34. }
  35. try {
  36. *pClsID=m_pObj->m_clsID;
  37. } catch (...) {
  38. hr = E_POINTER;
  39. }
  40. return hr;
  41. }
  42. /*
  43. * CImpIPerPropertyBrowsing::GetDisplayString
  44. *
  45. * Purpose:
  46. * Returns a text string describing the property identified with DispID.
  47. *
  48. * Parameters:
  49. * dispID Dispatch identifier for the property.
  50. * pBstr Receives a pointer to the display string describing the property
  51. */
  52. STDMETHODIMP CImpIPerPropertyBrowsing::GetDisplayString (
  53. DISPID /* dispID */,
  54. BSTR* /* pBstr */ )
  55. {
  56. /*
  57. HRESULT hr = S_OK;
  58. VARIANT vValue;
  59. if (NULL==pIPropBag)
  60. return ResultFromScode(E_POINTER);
  61. //Read all the data into the control structure.
  62. hr = m_pObj->m_pCtrl->LoadFromPropertyBag ( pIPropBag, pIError );
  63. return hr;
  64. */
  65. return E_NOTIMPL;
  66. }
  67. /*
  68. * CImpIPerPropertyBrowsing::GetPredefinedStrings
  69. *
  70. * Purpose:
  71. * Returns a counted array of strings, each corresponding to a value that the
  72. * property specified by dispID can accept.
  73. *
  74. * Parameters:
  75. * dispID Dispatch identifier for the property.
  76. * pcaStringsOut Receives a pointer to an array of strings
  77. * pcaCookiesOut Receives a pointer to an array of DWORDs
  78. */
  79. STDMETHODIMP CImpIPerPropertyBrowsing::GetPredefinedStrings (
  80. DISPID /* dispID */,
  81. CALPOLESTR* /* pcaStringsOut */,
  82. CADWORD* /* pcaCookiesOut */ )
  83. {
  84. return E_NOTIMPL;
  85. }
  86. /*
  87. * CImpIPerPropertyBrowsing::GetPredefinedValue
  88. *
  89. * Purpose:
  90. * Returns a variant containing the value of the property specified by dispID.
  91. *
  92. * Parameters:
  93. * dispID Dispatch identifier for the property.
  94. * dwCookie Token returned by GetPredefinedStrings
  95. * pVarOut Receives a pointer to a VARIANT value for the property.
  96. */
  97. STDMETHODIMP CImpIPerPropertyBrowsing::GetPredefinedValue (
  98. DISPID /* dispID */,
  99. DWORD /* dwCookie */,
  100. VARIANT* /* pVarOut */ )
  101. {
  102. return E_NOTIMPL;
  103. }
  104. /*
  105. * CImpIPerPropertyBrowsing::MapPropertyToPage
  106. *
  107. * Purpose:
  108. * Returns the CLSID of the property page associated with
  109. * the property specified by dispID.
  110. *
  111. * Parameters:
  112. * dispID Dispatch identifier for the property.
  113. * pClsid Receives a pointer to the CLSID of the property page.
  114. */
  115. STDMETHODIMP CImpIPerPropertyBrowsing::MapPropertyToPage (
  116. DISPID dispID,
  117. LPCLSID pClsID
  118. )
  119. {
  120. HRESULT hr = S_OK;
  121. if (pClsID == NULL) {
  122. return E_POINTER;
  123. }
  124. try {
  125. if ( DISPID_VALUE == dispID ) {
  126. // Data page
  127. *pClsID = CLSID_CounterPropPage;
  128. } else if ( DISPID_SYSMON_DATASOURCETYPE == dispID ) {
  129. // Source page
  130. *pClsID = CLSID_SourcePropPage;
  131. } else {
  132. // General page is default
  133. *pClsID = CLSID_GeneralPropPage;
  134. }
  135. } catch (...) {
  136. hr = E_POINTER;
  137. }
  138. return hr;
  139. }