ICONSITE.CPP
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:4k
源码类别:

Windows编程

开发平台:

Visual C++

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