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 / iproppg2.cpp < prev    next >
C/C++ Source or Header  |  1995-05-03  |  6KB  |  304 lines

  1. /*
  2.  * IPROPPG2.CPP
  3.  *
  4.  * Template IPropertyPage2 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 "iproppg2.h"
  15.  
  16.  
  17. /*
  18.  * CImpIPropertyPage2::CImpIPropertyPage2
  19.  * CImpIPropertyPage2::~CImpIPropertyPage2
  20.  *
  21.  * Parameters (Constructor):
  22.  *  pObj            LPVOID of the object we're in.
  23.  *  pUnkOuter       LPUNKNOWN to which we delegate.
  24.  */
  25.  
  26. CImpIPropertyPage2::CImpIPropertyPage2(LPVOID pObj
  27.     , LPUNKNOWN pUnkOuter)
  28.     {
  29.     m_cRef=0;
  30.     m_pObj=pObj;
  31.     m_pUnkOuter=pUnkOuter;
  32.     return;
  33.     }
  34.  
  35. CImpIPropertyPage2::~CImpIPropertyPage2(void)
  36.     {
  37.     return;
  38.     }
  39.  
  40.  
  41.  
  42. /*
  43.  * CImpIPropertyPage2::QueryInterface
  44.  * CImpIPropertyPage2::AddRef
  45.  * CImpIPropertyPage2::Release
  46.  *
  47.  * Purpose:
  48.  *  Delegating IUnknown members for CImpIPropertyPage2.
  49.  */
  50.  
  51. STDMETHODIMP CImpIPropertyPage2::QueryInterface(REFIID riid
  52.     , LPVOID *ppv)
  53.     {
  54.     return m_pUnkOuter->QueryInterface(riid, ppv);
  55.     }
  56.  
  57. STDMETHODIMP_(ULONG) CImpIPropertyPage2::AddRef(void)
  58.     {
  59.     ++m_cRef;
  60.     return m_pUnkOuter->AddRef();
  61.     }
  62.  
  63. STDMETHODIMP_(ULONG) CImpIPropertyPage2::Release(void)
  64.     {
  65.     --m_cRef;
  66.     return m_pUnkOuter->Release();
  67.     }
  68.  
  69.  
  70.  
  71. /*
  72.  * CImpIPropertyPage2::SetPageSite
  73.  *
  74.  * Purpose:
  75.  *  Provides the property page with the IPropertyPageSite
  76.  *  that contains it.  SetPageSite(NULL) will be called as
  77.  *  part of the close sequence.
  78.  *
  79.  * Parameters:
  80.  *  pPageSite       LPPROPERTYPAGESITE pointer to the site.
  81.  */
  82.  
  83. STDMETHODIMP CImpIPropertyPage2::SetPageSite
  84.     (LPPROPERTYPAGESITE pPageSite)
  85.     {
  86.     return ResultFromScode(E_NOTIMPL);
  87.     }
  88.  
  89.  
  90.  
  91. /*
  92.  * CImpIPropertyPage2::Activate
  93.  *
  94.  * Purpose:
  95.  *  Instructs the property page to create a window in which to
  96.  *  display its contents, using the given parent window and
  97.  *  rectangle.  The window should be initially visible.
  98.  *
  99.  * Parameters:
  100.  *  hWndParent      HWND of the parent window.
  101.  *  prc             LPCRECT of the rectangle to use.
  102.  *  fModal          BOOL indicating whether the frame is modal.
  103.  */
  104.  
  105. STDMETHODIMP CImpIPropertyPage2::Activate(HWND hWndParent
  106.     , LPCRECT prc, BOOL fModal)
  107.     {
  108.     return ResultFromScode(E_NOTIMPL);
  109.     }
  110.  
  111.  
  112.  
  113. /*
  114.  * CImpIPropertyPage2::Deactivate
  115.  *
  116.  * Purpose:
  117.  *  Instructs the property page to destroy its window that was
  118.  *  created in Activate.
  119.  *
  120.  * Parameters:
  121.  *  None
  122.  */
  123.  
  124. STDMETHODIMP CImpIPropertyPage2::Deactivate(void)
  125.     {
  126.     return ResultFromScode(E_NOTIMPL);
  127.     }
  128.  
  129.  
  130.  
  131. /*
  132.  * CImpIPropertyPage2::GetPageInfo
  133.  *
  134.  * Purpose:
  135.  *  Fills a PROPPAGEINFO structure describing the page's size,
  136.  *  contents, and help information.
  137.  *
  138.  * Parameters:
  139.  *  pPageInfo       LPPROPPAGEINFO to the structure to fill.
  140.  */
  141.  
  142. STDMETHODIMP CImpIPropertyPage2::GetPageInfo(LPPROPPAGEINFO pPageInfo)
  143.     {
  144.     return ResultFromScode(E_NOTIMPL);
  145.     }
  146.  
  147.  
  148.  
  149. /*
  150.  * CImpIPropertyPage2::SetObjects
  151.  *
  152.  * Purpose:
  153.  *  Identifies the objects that are being affected by this property
  154.  *  page (and all other pages in the frame).  These are the object
  155.  *  to which to send new property values in the Apply member.
  156.  *
  157.  * Parameters:
  158.  *  cObjects        ULONG number of objects
  159.  *  ppUnk           IUnknown ** to the array of objects being
  160.  *                  passed to the page.
  161.  */
  162.  
  163. STDMETHODIMP CImpIPropertyPage2::SetObjects(ULONG cObjects
  164.     , IUnknown **ppunk)
  165.     {
  166.     return ResultFromScode(E_NOTIMPL);
  167.     }
  168.  
  169.  
  170.  
  171. /*
  172.  * CImpIPropertyPage2::Show
  173.  *
  174.  * Purpose:
  175.  *  Instructs the page to show or hide its window created in
  176.  *  Activate.
  177.  *
  178.  * Parameters:
  179.  *  nCmdShow        UINT to pass to ShowWindow.
  180.  */
  181.  
  182. STDMETHODIMP CImpIPropertyPage2::Show(UINT nCmdShow)
  183.     {
  184.     return ResultFromScode(E_NOTIMPL);
  185.     }
  186.  
  187.  
  188.  
  189. /*
  190.  * CImpIPropertyPage2::Move
  191.  *
  192.  * Purpose:
  193.  *  Instructs the property page to change its position.
  194.  *
  195.  * Parameters:
  196.  *  prc             LPCRECT containing the new position.
  197.  */
  198.  
  199. STDMETHODIMP CImpIPropertyPage2::Move(LPCRECT prc)
  200.     {
  201.     return ResultFromScode(E_NOTIMPL);
  202.     }
  203.  
  204.  
  205.  
  206. /*
  207.  * CImpIPropertyPage2::IsPageDirty
  208.  *
  209.  * Purpose:
  210.  *  Asks the page if anything's changed in it, that is, if the
  211.  *  property values in the page are out of sync with the objects
  212.  *  under consideration.
  213.  *
  214.  * Parameters:
  215.  *  None
  216.  *
  217.  * Return Value:
  218.  *  HRESULT         NOERROR if dirty, S_FALSE if not.
  219.  */
  220.  
  221. STDMETHODIMP CImpIPropertyPage2::IsPageDirty(void)
  222.     {
  223.     return ResultFromScode(E_NOTIMPL);
  224.     }
  225.  
  226.  
  227.  
  228.  
  229. /*
  230.  * CImpIPropertyPage2::Apply
  231.  *
  232.  * Purpose:
  233.  *  Instructs the page to send changes in its page to whatever
  234.  *  objects it knows about through SetObjects.  This is the only
  235.  *  time the page should change the objects' properties, and not
  236.  *  when the value is changed on the page.
  237.  *
  238.  * Parameters:
  239.  *  None
  240.  */
  241.  
  242. STDMETHODIMP CImpIPropertyPage2::Apply(void)
  243.     {
  244.     return ResultFromScode(E_NOTIMPL);
  245.     }
  246.  
  247.  
  248.  
  249. /*
  250.  * CImpIPropertyPage2::Help
  251.  *
  252.  * Purpose:
  253.  *  Invokes help for this property page.
  254.  *
  255.  * Parameters:
  256.  *  pszHelpDir      LPCOLESTR identifying the default location of
  257.  *                  the help information
  258.  */
  259.  
  260. STDMETHODIMP CImpIPropertyPage2::Help(LPCOLESTR pszHelpDir)
  261.     {
  262.     return ResultFromScode(E_NOTIMPL);
  263.     }
  264.  
  265.  
  266.  
  267.  
  268. /*
  269.  * CImpIPropertyPage2::TranslateAccelerator
  270.  *
  271.  * Purpose:
  272.  *  Provides the page with the messages that occur in the frame.
  273.  *  This gives the page to do whatever it wants with the message,
  274.  *  such as handle keyboard mnemonics.
  275.  *
  276.  * Parameters:
  277.  *  pMsg            LPMSG containing the message of the accelerator.
  278.  */
  279.  
  280. STDMETHODIMP CImpIPropertyPage2::TranslateAccelerator(LPMSG lpMsg)
  281.     {
  282.     return ResultFromScode(E_NOTIMPL);
  283.     }
  284.  
  285.  
  286.  
  287.  
  288. /*
  289.  * CImpIPropertyPage2::EditProperty
  290.  *
  291.  * Purpose:
  292.  *  Informs the property page to speifically set focus to a
  293.  *  particular property identified with dispID.  Support for this
  294.  *  method is optional.
  295.  *
  296.  * Parameters:
  297.  *  dispID          DISPID of the property to highlight.
  298.  */
  299.  
  300. STDMETHODIMP CImpIPropertyPage2::EditProperty(DISPID dispid)
  301.     {
  302.     return ResultFromScode(E_NOTIMPL);
  303.     }
  304.