IObjectWithSite::GetSite method (ocidl.h)

Retrieves the latest site passed using SetSite.

Syntax

HRESULT GetSite(
  [in]  REFIID riid,
  [out] void   **ppvSite
);

Parameters

[in] riid

The IID of the interface pointer that should be returned in ppvSite.

[out] ppvSite

Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvSite contains the requested interface pointer to the site last seen in SetSite. The specific interface returned depends on the riid argument. In essence, the two arguments act identically to those in QueryInterface. If the appropriate interface pointer is available, the object must call AddRef on that pointer before returning successfully. If no site is available, or the requested interface is not supported, this method must *ppvSite to NULL and return a failure code.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return code Description
E_FAIL
There is no site, in which case *ppvSite contains NULL on return.
E_NOINTERFACE
There is a site, but it does not support the interface requested by riid.

Remarks

E_NOTIMPL is not allowed. Any object implementing this interface must be able to return the last site seen in IObjectWithSite::SetSite.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ocidl.h

See also

IObjectWithSite