The IObjectWithSite InterfaceThe IObjectWithSite Interface*
*



Contents  *



Index  *Topic Contents
*Previous Topic: IServiceProvider::QueryService
*Next Topic: IObjectWithSite::GetSite

IObjectWithSite

Often, an object needs to communicate directly with a "container site" that is managing the object itself. Outside of IOleObject::SetClientSite, there is no generic means through which an object becomes aware of its site. IObjectWithSite provides simple objects with a lightweight means (lighter than IOleObject) with a siting mechanism. This interface should only be used when IOleObject is not already in use.

Through IObjectWithSite, a container can pass the IUnknown pointer of its site to the object through SetSite. Callers can also retrieve the latest site passed to SetSite through GetSite. This latter function is included as a hooking mechanism, allowing a third party to intercept calls from the object to the site.

IDL:

[
uuid(fc4801a3-2ba9-11cf-a229-00aa003d7352)
    , object,pointer_default(unique)
]
interface IObjectWithSite : IUnknown
    {
    HRESULT SetSite([in] IUnknown *pUnkSite);
    HRESULT GetSite([in] REFIID riid, [out, iid_is(riid)] void **ppvSite);
    }

arrowg.gifIObjectWithSite::GetSite

arrowg.gifIObjectWithSite::SetSite


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.