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.

151 lines
3.4 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. *pClsID=m_pObj->m_clsID;
  32. return NOERROR;
  33. }
  34. /*
  35. * CImpIPerPropertyBrowsing::GetDisplayString
  36. *
  37. * Purpose:
  38. * Returns a text string describing the property identified with DispID.
  39. *
  40. * Parameters:
  41. * dispID Dispatch identifier for the property.
  42. * pBstr Receives a pointer to the display string describing the property
  43. */
  44. STDMETHODIMP CImpIPerPropertyBrowsing::GetDisplayString (
  45. DISPID /* dispID */,
  46. BSTR* /* pBstr */ )
  47. {
  48. /*
  49. HRESULT hr = S_OK;
  50. VARIANT vValue;
  51. if (NULL==pIPropBag)
  52. return ResultFromScode(E_POINTER);
  53. //Read all the data into the control structure.
  54. hr = m_pObj->m_pCtrl->LoadFromPropertyBag ( pIPropBag, pIError );
  55. return hr;
  56. */
  57. return E_NOTIMPL;
  58. }
  59. /*
  60. * CImpIPerPropertyBrowsing::GetPredefinedStrings
  61. *
  62. * Purpose:
  63. * Returns a counted array of strings, each corresponding to a value that the
  64. * property specified by dispID can accept.
  65. *
  66. * Parameters:
  67. * dispID Dispatch identifier for the property.
  68. * pcaStringsOut Receives a pointer to an array of strings
  69. * pcaCookiesOut Receives a pointer to an array of DWORDs
  70. */
  71. STDMETHODIMP CImpIPerPropertyBrowsing::GetPredefinedStrings (
  72. DISPID /* dispID */,
  73. CALPOLESTR* /* pcaStringsOut */,
  74. CADWORD* /* pcaCookiesOut */ )
  75. {
  76. return E_NOTIMPL;
  77. }
  78. /*
  79. * CImpIPerPropertyBrowsing::GetPredefinedValue
  80. *
  81. * Purpose:
  82. * Returns a variant containing the value of the property specified by dispID.
  83. *
  84. * Parameters:
  85. * dispID Dispatch identifier for the property.
  86. * dwCookie Token returned by GetPredefinedStrings
  87. * pVarOut Receives a pointer to a VARIANT value for the property.
  88. */
  89. STDMETHODIMP CImpIPerPropertyBrowsing::GetPredefinedValue (
  90. DISPID /* dispID */,
  91. DWORD /* dwCookie */,
  92. VARIANT* /* pVarOut */ )
  93. {
  94. return E_NOTIMPL;
  95. }
  96. /*
  97. * CImpIPerPropertyBrowsing::MapPropertyToPage
  98. *
  99. * Purpose:
  100. * Returns the CLSID of the property page associated with
  101. * the property specified by dispID.
  102. *
  103. * Parameters:
  104. * dispID Dispatch identifier for the property.
  105. * pClsid Receives a pointer to the CLSID of the property page.
  106. */
  107. STDMETHODIMP CImpIPerPropertyBrowsing::MapPropertyToPage (
  108. DISPID dispID,
  109. LPCLSID pClsid )
  110. {
  111. HRESULT hr = E_POINTER;
  112. if ( NULL != pClsid ) {
  113. hr = S_OK;
  114. if ( DISPID_VALUE == dispID ) {
  115. // Data page
  116. *pClsid = CLSID_CounterPropPage;
  117. } else if ( DISPID_SYSMON_DATASOURCETYPE == dispID ) {
  118. // Source page
  119. *pClsid = CLSID_SourcePropPage;
  120. } else {
  121. // General page is default
  122. *pClsid = CLSID_GeneralPropPage;
  123. }
  124. }
  125. return hr;
  126. }