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 / iconsite.cpp < prev    next >
C/C++ Source or Header  |  1995-05-03  |  4KB  |  221 lines

  1. /*
  2.  * ICONSITE.CPP
  3.  *
  4.  * Template IOleControlSite 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 "iconsite.h"
  15.  
  16.  
  17. /*
  18.  * CImpIOleControlSite::CImpIOleControlSite
  19.  * CImpIOleControlSite::~CImpIOleControlSite
  20.  *
  21.  * Parameters (Constructor):
  22.  *  pObj            LPVOID of the object we're in.
  23.  *  pUnkOuter       LPUNKNOWN to which we delegate.
  24.  */
  25.  
  26. CImpIOleControlSite::CImpIOleControlSite(LPVOID pObj
  27.     , LPUNKNOWN pUnkOuter)
  28.     {
  29.     m_cRef=0;
  30.     m_pObj=pObj;
  31.     m_pUnkOuter=pUnkOuter;
  32.     return;
  33.     }
  34.  
  35. CImpIOleControlSite::~CImpIOleControlSite(void)
  36.     {
  37.     return;
  38.     }
  39.  
  40.  
  41.  
  42. /*
  43.  * CImpIOleControlSite::QueryInterface
  44.  * CImpIOleControlSite::AddRef
  45.  * CImpIOleControlSite::Release
  46.  *
  47.  * Purpose:
  48.  *  Delegating IUnknown members for CImpIOleControlSite.
  49.  */
  50.  
  51. STDMETHODIMP CImpIOleControlSite::QueryInterface(REFIID riid
  52.     , LPVOID *ppv)
  53.     {
  54.     return m_pUnkOuter->QueryInterface(riid, ppv);
  55.     }
  56.  
  57. STDMETHODIMP_(ULONG) CImpIOleControlSite::AddRef(void)
  58.     {
  59.     ++m_cRef;
  60.     return m_pUnkOuter->AddRef();
  61.     }
  62.  
  63. STDMETHODIMP_(ULONG) CImpIOleControlSite::Release(void)
  64.     {
  65.     --m_cRef;
  66.     return m_pUnkOuter->Release();
  67.     }
  68.  
  69.  
  70.  
  71.  
  72.  
  73. /*
  74.  * CImpIOleControlSite::OnControlInfoChanged
  75.  *
  76.  * Purpose:
  77.  *  Informs the site that the CONTROLINFO for the control has
  78.  *  changed and we thus need to reload the data.
  79.  *
  80.  * Parameters:
  81.  *  None
  82.  */
  83.  
  84. STDMETHODIMP CImpIOleControlSite::OnControlInfoChanged(void)
  85.     {
  86.     return NOERROR;
  87.     }
  88.  
  89.  
  90.  
  91.  
  92.  
  93. /*
  94.  * CImpIOleControlSite::LockInPlaceActive
  95.  *
  96.  * Purpose:
  97.  *  Forces the container to keep this control in-place active
  98.  *  (but not UI active) regardless of other considerations, or
  99.  *  removes this lock.
  100.  *
  101.  * Parameters:
  102.  *  fLock           BOOL indicating to lock (TRUE) or unlock (FALSE)
  103.  *                  in-place activation.
  104.  */
  105.  
  106. STDMETHODIMP CImpIOleControlSite::LockInPlaceActive(BOOL fLock)
  107.     {
  108.     return ResultFromScode(E_NOTIMPL);
  109.     }
  110.  
  111.  
  112.  
  113.  
  114.  
  115. /*
  116.  * CImpIOleControlSite::GetExtendedControl
  117.  *
  118.  * Purpose:
  119.  *  Returns a pointer to the container's extended control that wraps
  120.  *  the actual control in this site, if one exists.
  121.  *
  122.  * Parameters:
  123.  *  ppDispatch      LPDISPATCH * in which to return the pointer
  124.  *                  to the extended control's IDispatch interface.
  125.  */
  126.  
  127. STDMETHODIMP CImpIOleControlSite::GetExtendedControl(LPDISPATCH
  128.     *ppDispatch)
  129.     {
  130.     *ppDispatch=NULL;
  131.     return ResultFromScode(E_NOTIMPL);
  132.     }
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. /*
  140.  * CImpIOleControlSite::TransformCoords
  141.  *
  142.  * Purpose:
  143.  *  Converts coordinates in HIMETRIC units into those used by the
  144.  *  container.
  145.  *
  146.  * Parameters:
  147.  *  pptlHiMet       POINTL * containing the coordinates to transform
  148.  *  pptlCont        POINTF * in which to return the new coordinates
  149.  *  dwFlags         DWORD containing instructional flags.
  150.  */
  151.  
  152. STDMETHODIMP CImpIOleControlSite::TransformCoords(POINTL *pptlHiMet
  153.     , POINTF *pptlCont, DWORD dwFlags)
  154.     {
  155.     return ResultFromScode(E_NOTIMPL);
  156.     }
  157.  
  158.  
  159.  
  160.  
  161.  
  162. /*
  163.  * CImpIOleControlSite::TranslateAccelerator
  164.  *
  165.  * Purpose:
  166.  *  Instructs the object to translate a keyboard accelerator
  167.  *  message that the control has picked up instead.
  168.  *
  169.  * Parameters:
  170.  *  pMsg            LPMSG to the message to translate.
  171.  *  grfModifiers    DWORD flags with additional instructions.
  172.  */
  173.  
  174. STDMETHODIMP CImpIOleControlSite::TranslateAccelerator(LPMSG pMsg
  175.     , DWORD grfModifiers)
  176.     {
  177.     return ResultFromScode(E_NOTIMPL);
  178.     }
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. /*
  186.  * CImpIOleControlSite::OnFocus
  187.  *
  188.  * Purpose:
  189.  *  Informs the container that focus has either been lost or
  190.  *  gained in the control.
  191.  *
  192.  * Parameters:
  193.  *  fGotFocus       BOOL indicating that the control gained (TRUE)
  194.  *                  or lost (FALSE) focus.
  195.  */
  196.  
  197. STDMETHODIMP CImpIOleControlSite::OnFocus(BOOL fGotFocus)
  198.     {
  199.     return NOERROR;
  200.     }
  201.  
  202.  
  203.  
  204.  
  205. /*
  206.  * CImpIOleControlSite::ShowPropertyFrame
  207.  *
  208.  * Purpose:
  209.  *  Instructs the container to show the property frame if
  210.  *  this is an extended object and requires its own property
  211.  *  pages.
  212.  *
  213.  * Parameters:
  214.  *  None
  215.  */
  216.  
  217. STDMETHODIMP CImpIOleControlSite::ShowPropertyFrame(void)
  218.     {
  219.     return ResultFromScode(E_NOTIMPL);
  220.     }
  221.