IShellItem2::GetPropertyStoreWithCreateObject method (shobjidl_core.h)

Uses the specified ICreateObject instead of CoCreateInstance to create an instance of the property handler associated with the Shell item on which this method is called. Most calling applications do not need to call this method, and can call IShellItem2::GetPropertyStore instead.

Syntax

HRESULT GetPropertyStoreWithCreateObject(
  [in]  GETPROPERTYSTOREFLAGS flags,
  [in]  IUnknown              *punkCreateObject,
  [in]  REFIID                riid,
  [out] void                  **ppv
);

Parameters

[in] flags

Type: GETPROPERTYSTOREFLAGS

The GETPROPERTYSTOREFLAGS constants that modify the property store object.

[in] punkCreateObject

Type: IUnknown*

A pointer to a factory for low-rights creation of type ICreateObject.

The method CreateObject creates an instance of a COM object. The implementation of IShellItem2::GetPropertyStoreWithCreateObject uses CreateObject instead of CoCreateInstance to create the property handler, which is a Shell extension, for a given file type. The property handler provides many of the important properties in the property store that this method returns.

This method is useful only if the ICreateObject object is created in a separate process (as a LOCALSERVER instead of an INPROCSERVER), and also if this other process has lower rights than the process calling IShellItem2::GetPropertyStoreWithCreateObject.

[in] riid

Type: REFIID

A reference to the IID of the object to be retrieved.

[out] ppv

Type: void**

When this method returns, contains the address of the requested IPropertyStore interface pointer.

Return value

Type: HRESULT

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

Remarks

Note  When this method is called on a property store for a file, that file is held open for the lifetime of the IPropertyStore object.
 

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)