Contents Previous Page Next Page
IObjectWithSite::SetSite

Provides the siteÆs IUnknown pointer to the object. 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.

HRESULT SetSite(

    IUnknown * 
pUnkSite        // Pointer to IUnknown of the site managing this object          
                                                                                                
   );                                                                                           
                                                                                                

Parameter

pUnkSite

[in] The interface pointer of the site managing this object. If NULL, the object should call IUnknown::Release on any existing site at which point the object no longer knows its site.

Return Value

S_OK

Returned in all circumstances.

Remarks

E_NOTIMPL is not allowed20000000.gifwithout implementation of the SetSite method, the IObjectWithSite interface is unnecessary.

See Also

IObjectWithSite::GetSite