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 GetSitemethod retrieves the last site set with IObjectWithSite::SetSite.

Syntax

HRESULT GetSite (
  REFIID 
riid,
  void ** 
ppvSite
);

Parameters

riid

[in] Specifies the interface you want to use. This is the interface identifier (IID) of the interface pointer returned in the member variable ppvSite.

ppvSite

[out] The address of the pointer variable that receives the interface pointer returned in riid. On success, *ppvSitecontains the requested interface pointer to the last site that was set with the method IObjectWithSite::SetSite. The specific interface that is returned depends on the riidargument. This makes riidand ppvSiteperform the same functions as those in the Windows Embedded CE IUnknown::QueryInterfacemethod. If the appropriate interface pointer is available, the object must call the Windows Embedded CE IUnknown::AddRefmethod on that pointer before returning. If no site is available or if the requested interface is not supported, GetSitemust cast *ppvSiteto NULLand return an appropriate error code.

Return Value

S_OK

Indicates that GetSitewas able to successfully return a site previously set with IObjectWithSite::SetSite. You must call IUnknown::Releasewhen the site is no longer needed.

E_FAIL

There is no site, and *ppvSitecontains NULL.

E_NOINTERFACE

There is a site, but it does not support the interface you requested in the member variable riid.

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