IObjectWithSiteImpl

template< class T >
class IObjectWithSiteImpl

Parameters

T Your class, derived from IObjectWithSiteImpl.

The IObjectWithSite interface allows an object to communicate with its site. Class IObjectWithSiteImpl provides a default implementation of this interface and implements IUnknown by sending information to the dump device in debug builds.

IObjectWithSiteImpl specifies two methods. The client first calls SetSite, passing the site's IUnknown pointer. This pointer is stored within the object, and can later be retrieved through a call to GetSite.

Typically, you derive your class from IObjectWithSiteImpl when you are creating an object that is not a control. For controls, derive your class from IOleObjectImpl, which also provides a site pointer. Do not derive your class from both IObjectWithSiteImpl and IOleObjectImpl.

#include <atlcom.h>

See Also IObjectWithSite in the Win32 SDK


IObjectWithSiteImpl Class Members

IObjectWithSite Methods
GetSiteQueries the site for an interface pointer.
SetSiteProvides the object with the site's IUnknown pointer.
Data Members
m_spUnkSiteManages the site's IUnknown pointer.

IObjectWithSiteImpl Overview


Methods


IObjectWithSiteImpl::GetSite

HRESULT GetSite( REFIID riid, void **ppvSite );

See IObjectWithSite::GetSite in the Win32 SDK.

Remarks

Queries the site for a pointer to the interface identified by riid. If the site supports this interface, the pointer is returned via ppvSite. Otherwise, ppvSite is set to NULL.

IObjectWithSiteImpl Overview | Class Members

See Also IObjectWithSiteImpl::SetSite


IObjectWithSiteImpl::SetSite

HRESULT SetSite( IUnknown* pUnkSite );

See IObjectWithSite::SetSite in the Win32 SDK.

Remarks

Provides the object with the site’s IUnknown pointer.

IObjectWithSiteImpl Overview | Class Members

See Also IObjectWithSiteImpl::GetSite


Data Members


IObjectWithSiteImpl::m_spUnkSite

CComPtr< IUnknown > m_spUnkSite;

Remarks

Manages the site's IUnknown pointer. m_spUnkSite initially receives this pointer through a call to SetSite.

IObjectWithSiteImpl Overview | Class Members

See Also CComPtr