Επεξεργασία

Κοινή χρήση μέσω


SHBindToObject function (shlobj_core.h)

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

Syntax

SHSTDAPI 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.

[in] 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.

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

Requirement Value
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