Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The IObjectWithSiteinterface provides simple objects with a light-weight "siting" mechanism. This allows simple objects to communicate directly with their container site objects, allowing them to manage the site object by themselves.

Note:
If you use IObjectWithSite, do not use the Windows Embedded CE IOleObjectinterface.

A container can pass the IUnknownpointer of its site to an object through IObjectWithSite::SetSite. Callers can also retrieve the latest site passed to IObjectWithSite::SetSitethrough IObjectWithSite::GetSite. This usage provides a hooking mechanism, allowing third parties to intercept calls from an object to its container site object.

When to Implement

Implement this interface when you want to give an object the ability to manage its container site object.

When to Use

A container calls the IObjectWithSite::SetSitemethod to provide an object with an interface pointer to its site.

Methods in Vtable Order

  • IUnknownmethods

    IObjectWithSite methods Description

    SetSite

    Passes the container site object's IUnknownpointer to the object being managed.

    GetSite

    Retrieves the IUnknownpointer from the last site set with IObjectWithSite::SetSite.

Requirements

Header ocidl.h
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2000 and later, Smartphone 2002 and later

See Also

Reference

Shell Interfaces