Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
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 (lighter than IOleObject) 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); }
IObjectWithSite Methods
GetSite Retrieves the last site set with IObjectWithSite::SetSite. SetSite Provides the site's IUnknown pointer to the object.
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.