SHPropStgCreate function

[This function is available through Windows XP Service Pack 2 (SP2) and Windows Server 2003. It might be altered or unavailable in subsequent versions of Windows.]

Ensures proper handling of code page retrieval or assignment for the requested property set operation.

Syntax


HRESULT SHPropStgCreate(
  _In_            IPropertySetStorage *psstg,
  _In_            REFFMTID            fmtid,
  _In_opt_  const CLSID               *pclsid,
                  DWORD               grfFlags,
                  DWORD               grfMode,
                  DWORD               dwDisposition,
  _Out_           IPropertyStorage    **ppstg,
  _Out_opt_       UINT                *puCodePage
);

Parameters

psstg [in]

Type: IPropertySetStorage*

A pointer to an IPropertySetStorage interface.

fmtid [in]

Type: REFFMTID

A property set ID to open. The values for this parameter can be either one of those defined in Predefined Property Set Format Identifiers or any other FMTID that you register.

pclsid [in, optional]

Type: const CLSID*

A pointer to the CLSID associated with the set. This parameter can be NULL.

grfFlags

Type: DWORD

One or more members of the PROPSETFLAG enumeration that determine how the property set is created and opened. All sets containing ANSI bytes should be created with PROPSETFLAG_ANSI, otherwise PROPSETFLAG_DEFAULT.

grfMode

Type: DWORD

The flags from the STGM enumeration that indicate conditions for creating and deleting the object and access modes for the object. Must contain STGM_DIRECT | STGM_SHARE_EXCLUSIVE.

dwDisposition

Type: DWORD

One of the following values, defined in Fileapi.h.

CREATE_NEW (1)

Create a new set if one does not already exist.

CREATE_ALWAYS (2)

Always create a new set, overwriting any existing set.

OPEN_EXISTING (3)

Open the existing set.

OPEN_ALWAYS (4)

ppstg [out]

Type: IPropertyStorage**

When this method returns, contains an IPropertyStorage interface pointer.

puCodePage [out, optional]

Type: UINT*

When this method returns, contains the address of the code page ID for the set.

Return value

Type: HRESULT

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 6.0 or later)

 

 

Show: