IObjectWithSite::GetSite method

Retrieves the latest site passed using SetSite.

Syntax

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

Parameters

riid

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

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

   
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