Freigeben über


IObjectWithSite::GetSite

The GetSite method 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, * ppvSite contains 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 riid argument. This makes riid and ppvSite perform the same functions as those in the Windows CE IUnknown::QueryInterface method. If the appropriate interface pointer is available, the object must call the Windows CE IUnknown::AddRef method on that pointer before returning. If no site is available or if the requested interface is not supported, GetSite must cast *ppvSite to NULL and return an appropriate error code.

Return Values

  • S_OK
    Indicates that GetSite was able to successfully return a site previously set with IObjectWithSite::SetSite. You must call IUnknown::Release when the site is no longer needed.
  • E_FAIL
    There is no site, and *ppvSite contains NULL.
  • E_NOINTERFACE
    There is a site, but it does not support the interface you requested in the member variable riid.

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: Declared in ocidl.h

See Also

IObjectWithSite

IObjectWithSite::SetSite

IUnknown::AddRef

IUnknown::QueryInterface

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.