IObjectWithSite::SetSite method (ocidl.h)

Enables a container to pass an object a pointer to the interface for its site.

Syntax

HRESULT SetSite(
  [in] IUnknown *pUnkSite
);

Parameters

[in] pUnkSite

A pointer to the IUnknown interface pointer of the site managing this object. If NULL, the object should call Release on any existing site at which point the object no longer knows its site.

Return value

This method returns S_OK on success.

Remarks

The object should hold onto this pointer, calling IUnknown::AddRef in doing so. If the object already has a site, it should call that existing site's IUnknown::Release, save the new site pointer, and call the new site's IUnknown::AddRef.

E_NOTIMPL is not allowed. Without implementation of the SetSite method, the IObjectWithSite interface is unnecessary.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ocidl.h

See also

IObjectWithSite