You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
549 B
29 lines
549 B
#include <objbase.h>
|
|
#pragma hdrstop
|
|
|
|
#include "cowsite.h"
|
|
|
|
void IUnknown_Set(IUnknown ** ppunk, IUnknown * punk)
|
|
{
|
|
if (*ppunk)
|
|
(*ppunk)->Release();
|
|
|
|
*ppunk = punk;
|
|
if (punk)
|
|
punk->AddRef();
|
|
}
|
|
|
|
HRESULT CObjectWithSite::SetSite(IUnknown *punkSite)
|
|
{
|
|
IUnknown_Set(&_punkSite, punkSite);
|
|
return S_OK;
|
|
}
|
|
|
|
HRESULT CObjectWithSite::GetSite(REFIID riid, void **ppvSite)
|
|
{
|
|
if (_punkSite)
|
|
return _punkSite->QueryInterface(riid, ppvSite);
|
|
|
|
*ppvSite = NULL;
|
|
return E_FAIL;
|
|
}
|