IObjectWithSite::GetSite
4/8/2010
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 Embedded CE IUnknown::QueryInterfacemethod. If the appropriate interface pointer is available, the object must call the Windows Embedded 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 Value
- 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
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
Reference
IContextMenu
IObjectWithSite
IObjectWithSite::SetSite