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
/
iclisite.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-03
|
4KB
|
204 lines
/*
* ICLISITE.CPP
*
* Template IOleClientSite interface implementation.
*
* Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
*
* Kraig Brockschmidt, Microsoft
* Internet : kraigb@microsoft.com
* Compuserve: >INTERNET:kraigb@microsoft.com
*/
#include "iclisite.h"
/*
* CImpIOleClientSite::CImpIOleClientSite
* CImpIOleClientSite::~CImpIOleClientSite
*
* Parameters (Constructor):
* pObj LPVOID of the object we're in.
* pUnkOuter LPUNKNOWN to which we delegate.
*/
CImpIOleClientSite::CImpIOleClientSite(LPVOID pObj
, LPUNKNOWN pUnkOuter)
{
m_cRef=0;
m_pObj=pObj;
m_pUnkOuter=pUnkOuter;
return;
}
CImpIOleClientSite::~CImpIOleClientSite(void)
{
return;
}
/*
* CImpIOleClientSite::QueryInterface
* CImpIOleClientSite::AddRef
* CImpIOleClientSite::Release
*
* Purpose:
* Delegating IUnknown members for CImpIOleClientSite.
*/
STDMETHODIMP CImpIOleClientSite::QueryInterface(REFIID riid
, LPVOID *ppv)
{
return m_pUnkOuter->QueryInterface(riid, ppv);
}
STDMETHODIMP_(ULONG) CImpIOleClientSite::AddRef(void)
{
++m_cRef;
return m_pUnkOuter->AddRef();
}
STDMETHODIMP_(ULONG) CImpIOleClientSite::Release(void)
{
--m_cRef;
return m_pUnkOuter->Release();
}
/*
* CImpIOleClientSite::SaveObject
*
* Purpose:
* Requests that the container call OleSave for the object that
* lives here. Typically this happens on server shutdown.
*
* Parameters:
* None
*/
STDMETHODIMP CImpIOleClientSite::SaveObject(void)
{
return NOERROR;
}
/*
* CImpIOleClientSite::GetMoniker
*
* Purpose:
* Retrieves the moniker for the site in which this object lives,
* either the moniker relative to the container or the full
* moniker.
*
* Parameters:
* dwAssign DWORD specifying that the object wants moniker
* assignment.
* dwWhich DWORD identifying which moniker the object wants,
* either the container's moniker, the moniker
* relative to this client site, or the full moniker.
*/
STDMETHODIMP CImpIOleClientSite::GetMoniker(DWORD dwAssign
, DWORD dwWhich, LPMONIKER *ppmk)
{
//Only necessary if you allow linking to embeddings
*ppmk=NULL;
return ResultFromScode(E_NOTIMPL);
}
/*
* CImpIOleClientSite::GetContainer
*
* Purpose:
* Returns a pointer to the document's IOleContainer interface.
*
* Parameters:
* ppContainer LPOLECONTAINER * in which to return the
* interface.
*/
STDMETHODIMP CImpIOleClientSite::GetContainer(LPOLECONTAINER
*ppContainer)
{
//Only necessary if you allow linking to embeddings
*ppContainer=NULL;
return ResultFromScode(E_NOTIMPL);
}
/*
* CImpIOleClientSite::ShowObject
*
* Purpose:
* Tells the container to bring the object fully into view as
* much as possible, that is, scroll the document.
*
* Parameters:
* None
*/
STDMETHODIMP CImpIOleClientSite::ShowObject(void)
{
return NOERROR;
}
/*
* CImpIOleClientSite::OnShowWindow
*
* Purpose:
* Informs the container if the object is showing itself or
* hiding itself. This is done only in the opening mode and allows
* the container to know when to shade or unshade the object.
*
* Parameters:
* fShow BOOL indiciating that the object is being shown
* (TRUE) or hidden (FALSE).
*/
STDMETHODIMP CImpIOleClientSite::OnShowWindow(BOOL fShow)
{
return NOERROR;
}
/*
* CImpIOleClientSite::RequestNewObjectLayout
*
* Purpose:
* Called when the object needs more room in the container.
*
* Parameters:
* None
*/
STDMETHODIMP CImpIOleClientSite::RequestNewObjectLayout(void)
{
return ResultFromScode(E_NOTIMPL);
}