IInitializeWithItem::Initialize method

Initializes a handler with an IShellItem.

Syntax


HRESULT Initialize(
  [in] IShellItem *psi,
  [in] DWORD      grfMode
);

Parameters

psi [in]

Type: IShellItem*

A pointer to an IShellItem.

grfMode [in]

Type: DWORD

One of the following STGM values that indicate the access mode for psi.

STGM_READ

The IShellItem is read-only.

STGM_READWRITE

The IShellItem is read/write accessible.

Return value

Type: HRESULT

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

Remarks

If the IShellItem cannot be accessed, this method returns an appropriate error code.

A handler instance should be initialized only once in its lifetime. Attempts by the calling application to reinitialize the handler result in the error HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED).

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Propsys.h

IDL

Propsys.idl

 

 

Show: