Expand Minimize

SHBindToObject function

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

Syntax


HRESULT SHBindToObject(
  IShellFolder *psf,
  PCUIDLIST_RELATIVE pidl,
  _In_   IBindCtx *pbc,
  REFIID riid,
  _Out_  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 [in]

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 [out]

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]

Header

Shlobj.h

DLL

Shell32.dll

See also

IShellFolder
IShellFolder::BindToObject

 

 

Community Additions

ADD
Show:
© 2014 Microsoft