This topic has not yet been rated - Rate this topic

SHBindToObject function

Applies to: desktop apps only

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

Minimum supported server

Windows Server 2008

Header

Shlobj.h

DLL

Shell32.dll

See also

IShellFolder
IShellFolder::BindToObject

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ