SHBindToObject function

Retrieves and binds to a specified object by using the Shell namespace IShellFolder::BindToObject method.

Syntax

SHSTDAPI SHBindToObject(
  IShellFolder       *psf,
  PCUIDLIST_RELATIVE pidl,
  IBindCtx           *pbc,
  REFIID             riid,
  void               **ppv
);

Parameters

psf

Type: IShellFolder*

A pointer to IShellFolder. This parameter can be NULL. If psf is NULL, this indicates parameter pidl is relative to the desktop. In this case, pidl must specify an absolute ITEMIDLIST.

pidl

Type: PCUIDLIST_RELATIVE

A pointer to a constant ITEMIDLIST to bind to that is relative to psf. If psf is NULL, this is an absolute ITEMIDLIST relative to the desktop folder.

pbc

Type: IBindCtx*

A pointer to IBindCtx interface on a bind context object to be used during this operation. If this parameter is not used, set it to NULL. Because support for pbc is optional for folder object implementations, some folders may not support the use of bind contexts.

riid

Type: REFIID

Identifier of the interface to return.

ppv

Type: void**

When this method returns, contains the interface pointer as specified in riid to the bound object. If an error occurs, contains a NULL pointer.

Return Value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Note  This is a helper function that gets the desktop object by calling SHGetDesktopFolder.
 

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
DLL Shell32.dll

See Also

IShellFolder

IShellFolder::BindToObject