IUnknown_GetSite function (shlwapi.h)

Calls the specified object's IObjectWithSite::GetSite method.

Syntax

LWSTDAPI IUnknown_GetSite(
  [in]  IUnknown *punk,
  [in]  REFIID   riid,
  [out] void     **ppv
);

Parameters

[in] punk

Type: IUnknown*

A pointer to the COM object whose IObjectWithSite::GetSite method is to be called.

[in] riid

Type: REFIID

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

[out] ppv

Type: VOID**

The address of the pointer to receive the requested interface pointer. If the function call is successful, ppvSite will contain the requested interface pointer. If no site is available or the requested interface is not supported, ppvSite is set to NULL and the function returns a COM error code.

Return value

Type: HRESULT

Returns S_OK if the site was successfully retrieved or a COM error code otherwise.

Remarks

This function calls the specified object's QueryInterface method to obtain the IObjectWithSite interface. If successful, the function calls the interface's IObjectWithSite::GetSite method to obtain the site.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server, Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlwapi.h
DLL Shlwapi.dll (version 5.0 or later)