IObjectWithSite::GetSite

Retrieves the last site set with IObjectWithSite::SetSite. If there's no known site, the object return a failure code.

HRESULT GetSite(
  REFIID riid,    //IID of interface pointer being requested
  void** ppvSite  //Address of output variable that receives the 
                  // interface pointer requested in riid
);
 

Parameters

riid
[in] The IID of the interface pointer that should be returned in ppvSite.
ppvSite
[out] 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 IObjectWithSite::SetSite. The specific interface returned depends on the riid argument—in essence, the two arguments act identically to those in IUnknown::QueryInterface. If the appropriate interface pointer is available, the object must call IUnknown::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 Values

S_OK
The site was returned successfully and the caller is responsible for calling IUnknown::Release when the site is no longer needed.
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.

QuickInfo

  Windows NT: Use version 4.0 or later. New for OC96.
  Windows: Use Windows 95 or later. New for OC96.
  Windows CE: Unsupported.
  Header: Declared in ocidl.h.