Επεξεργασία

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


SHBindToParent function (shlobj_core.h)

Takes a pointer to a fully qualified item identifier list (PIDL), and returns a specified interface pointer on the parent object.

Syntax

SHSTDAPI SHBindToParent(
  [in]  PCIDLIST_ABSOLUTE pidl,
  [in]  REFIID            riid,
  [out] void              **ppv,
  [out] PCUITEMID_CHILD   *ppidlLast
);

Parameters

[in] pidl

Type: PCIDLIST_ABSOLUTE

The item's PIDL.

[in] riid

Type: REFIID

The REFIID of one of the interfaces exposed by the item's parent object.

[out] ppv

Type: VOID**

A pointer to the interface specified by riid. You must release the object when you are finished.

[out] ppidlLast

Type: PCUITEMID_CHILD*

The item's PIDL relative to the parent folder. This PIDL can be used with many of the methods supported by the parent folder's interfaces. If you set ppidlLast to NULL, the PIDL is not returned.

Note  SHBindToParent does not allocate a new PIDL; it simply receives a pointer through this parameter. Therefore, you are not responsible for freeing this resource.
 

Return value

Type: HRESULT

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

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
Library Shell32.lib
DLL Shell32.dll (version 5.0 or later)