The IObjectWithSite Interface provides simple objects with a lightweight (lighter than IOleObject) siting mechanism.
IObjectWithSite Methods
GetSite Retrieves the last site set with IObjectWithSite::SetSite. SetSite Provides the site's IUnknown pointer to the object.
Interface Information
Implementation Custom Inherits from IUnknown Header and IDL files Ocidl.h; Ocidl.idl Minimum availability Internet Explorer 4.0 Minimum operating systems Windows 95, Windows NT 4.0
Remarks
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 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.