home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / interfac / iperpbro.cpp < prev    next >
C/C++ Source or Header  |  1995-05-03  |  5KB  |  193 lines

  1. /*
  2.  * IPERPBRO.CPP
  3.  *
  4.  * Template IPerPropertyBrowsing interface implementation.
  5.  *
  6.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  7.  *
  8.  * Kraig Brockschmidt, Microsoft
  9.  * Internet  :  kraigb@microsoft.com
  10.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  11.  */
  12.  
  13.  
  14. #include "iperpbro.h"
  15.  
  16.  
  17. /*
  18.  * CImpIPerPropertyBrowsing::CImpIPerPropertyBrowsing
  19.  * CImpIPerPropertyBrowsing::~CImpIPerPropertyBrowsing
  20.  *
  21.  * Parameters (Constructor):
  22.  *  pObj            LPVOID of the object we're in.
  23.  *  pUnkOuter       LPUNKNOWN to which we delegate.
  24.  */
  25.  
  26. CImpIPerPropertyBrowsing::CImpIPerPropertyBrowsing(LPVOID pObj
  27.     , LPUNKNOWN pUnkOuter)
  28.     {
  29.     m_cRef=0;
  30.     m_pObj=pObj;
  31.     m_pUnkOuter=pUnkOuter;
  32.     return;
  33.     }
  34.  
  35. CImpIPerPropertyBrowsing::~CImpIPerPropertyBrowsing(void)
  36.     {
  37.     return;
  38.     }
  39.  
  40.  
  41.  
  42. /*
  43.  * CImpIPerPropertyBrowsing::QueryInterface
  44.  * CImpIPerPropertyBrowsing::AddRef
  45.  * CImpIPerPropertyBrowsing::Release
  46.  *
  47.  * Purpose:
  48.  *  Delegating IUnknown members for CImpIPerPropertyBrowsing.
  49.  */
  50.  
  51. STDMETHODIMP CImpIPerPropertyBrowsing::QueryInterface(REFIID riid
  52.     , LPVOID *ppv)
  53.     {
  54.     return m_pUnkOuter->QueryInterface(riid, ppv);
  55.     }
  56.  
  57. STDMETHODIMP_(ULONG) CImpIPerPropertyBrowsing::AddRef(void)
  58.     {
  59.     ++m_cRef;
  60.     return m_pUnkOuter->AddRef();
  61.     }
  62.  
  63. STDMETHODIMP_(ULONG) CImpIPerPropertyBrowsing::Release(void)
  64.     {
  65.     --m_cRef;
  66.     return m_pUnkOuter->Release();
  67.     }
  68.  
  69.  
  70.  
  71. /*
  72.  * CImpIPerPropertyBrowsing::OnStatusChange
  73.  *
  74.  * Purpose:
  75.  *  Informs the page site that the status of its page has changed
  76.  *  according to the flags in dwFlags:
  77.  *      PROPPAGESTATUS_DIRTY        A value was changed.
  78.  *      PROPPAGESTATUS_VALIDATE     It's an appropriate time to
  79.  *                                  validate and apply changes.
  80.  *
  81.  * Parameters:
  82.  *  dwFlags         DWORD identifying the changes.
  83.  */
  84.  
  85. STDMETHODIMP CImpIPerPropertyBrowsing::OnStatusChange(DWORD dwFlags)
  86.     {
  87.     return ResultFromScode(E_NOTIMPL);
  88.     }
  89.  
  90.  
  91.  
  92. /*
  93.  * CImpIPerPropertyBrowsing::GetDisplayString
  94.  *
  95.  * Purpose:
  96.  *  Retrieves a description string for a property.
  97.  *
  98.  * Parameters:
  99.  *  dispID          DISPID of the property in question.
  100.  *  pbstr           BSTR * in which to return the string that
  101.  *                  describes the property.  This can be NULL
  102.  *                  indicating that the caller only wants to
  103.  *                  know about availability of the string, not
  104.  *                  the string itself.
  105.  *
  106.  * Return Value:
  107.  *  HRESULT         NOERROR if a string is give, S_FALSE if
  108.  *                  a default string is acceptable.
  109.  */
  110.  
  111. STDMETHODIMP CImpIPerPropertyBrowsing::GetDisplayString
  112.     (DISPID dispid, BSTR *pbstr)
  113.     {
  114.     if (NULL!=pbstr)
  115.         *pbstr=NULL;
  116.  
  117.     return ResultFromScode(E_NOTIMPL);
  118.     }
  119.  
  120.  
  121.  
  122. /*
  123.  * CImpIPerPropertyBrowsing::MapPropertyToPage
  124.  *
  125.  * Purpose:
  126.  *  Maps a property with a given dispID to a property page CLSID
  127.  *  that can be used to edit this property.
  128.  *
  129.  * Parameters:
  130.  *  dispID          DISPID of the property in question
  131.  *  pCLSID          CLSID * in which to return the CLSID of the
  132.  *                  associated property page.
  133.  *
  134.  * Return Value:
  135.  *  HRESULT         NOERROR if a page is available but not necessarily
  136.  *                  needed to do editing.  S_FALSE if the page must be
  137.  *                  used for editing, CTL_E_NOPAGEAVAILABLE otherwise.
  138.  */
  139.  
  140. STDMETHODIMP CImpIPerPropertyBrowsing::MapPropertyToPage
  141.     (DISPID dispid, LPCLSID pCLSID)
  142.     {
  143.     *pCLSID=CLSID_NULL;
  144.     return ResultFromScode(E_NOTIMPL);
  145.     }
  146.  
  147.  
  148.  
  149.  
  150. /*
  151.  * CImpIPerPropertyBrowsing::GetPredefinedStrings
  152.  *
  153.  * Purpose:
  154.  *  Allows the property to define known legal strings that a browser
  155.  *  might display in a listbox.
  156.  *
  157.  * Parameters:
  158.  *  dispID          DISPID identifying the property.
  159.  *  pcaStringsOut   CALPOLESTR * in which to store the strings.
  160.  *  pcaCookiesOut   CADWORD * providing identifiers for each string.
  161.  */
  162.  
  163. STDMETHODIMP CImpIPerPropertyBrowsing::GetPredefinedStrings
  164.     (DISPID dispid, CALPOLESTR *pcaStringsOut
  165.     , CADWORD *pcaCookiesOut)
  166.     {
  167.     return ResultFromScode(E_NOTIMPL);
  168.     }
  169.  
  170.  
  171.  
  172.  
  173. /*
  174.  * CImpIPerPropertyBrowsing::GetPredefinedValue
  175.  *
  176.  * Purpose:
  177.  *  Allows the property to define a known legal value that a browser
  178.  *  might display as a default or use in valudation.
  179.  *
  180.  * Parameters:
  181.  *  dispID          DISPID identifying the property.
  182.  *  dwCookie        DWORD identifying the value from
  183.  *                  GetPredefinedStrings.
  184.  *  pVarOut         VARIANT * in which to return the value.
  185.  *
  186.  */
  187.  
  188. STDMETHODIMP CImpIPerPropertyBrowsing::GetPredefinedValue
  189.     (DISPID dispid, DWORD dwCookie, VARIANT *pVarOut)
  190.     {
  191.     return ResultFromScode(E_NOTIMPL);
  192.     }
  193.