Click to return to the Component Development home page    
IObjectWithSite::GetSite ...     IPersistHistory Interface     Component Interface Refer...    
Web Workshop  |  Component Development

IObjectWithSite::SetSite Method


Provides the site's IUnknown pointer to the object.

Syntax

HRESULT SetSite(
    IUnknown *pUnkSite
);

Parameters

pUnkSite
[in] Address of an interface pointer to the site managing this object. If NULL, the object should call IUnknown::Release to release the existing site.

Return Value

Returns S_OK in all circumstances.

Remarks

The object should hold onto the IUnknown pointer, calling AddRef in doing so. If the object already has a site, it should first call pUnkSite->AddRef to secure the new site, call IUnknown::Release on the existing site, and then save pUnkSite.

E_NOTIMPL is disallowed—without implementation of SetSite, the IObjectWithSite interface is unnecessary.



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.