Export (0) Print
Expand All
Expand Minimize

SHGetItemFromDataObject function

Creates an IShellItem or related object based on an item specified by an IDataObject.

Syntax


HRESULT SHGetItemFromDataObject(
  _In_   IDataObject *pdtobj,
  _In_   DATAOBJ_GET_ITEM_FLAGS dwFlags,
  _In_   REFIID riid,
  _Out_  void **ppv
);

Parameters

pdtobj [in]

Type: IDataObject*

A pointer to the source IDataObject instance.

dwFlags [in]

Type: DATAOBJ_GET_ITEM_FLAGS

One or more values from the DATAOBJ_GET_ITEM_FLAGS enumeration to specify options regarding the target object. This value can be 0.

riid [in]

Type: REFIID

A reference to the IID of the interface to retrieve through ppv, typically IID_IShellItem.

ppv [out]

Type: void**

When this method returns, contains the interface pointer requested in riid. This is typically IShellItem.

Return value

Type: HRESULT

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

Remarks

It is recommended that you use the IID_PPV_ARGS macro, defined in Objbase.h, to package the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Shobjidl.h

DLL

Shell32.dll (version 6.1 or later)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft