This topic has not yet been rated - Rate this topic

StgMakeUniqueName function

Applies to: desktop apps only

Creates a unique name for a stream or storage object from a template.

Syntax

HRESULT StgMakeUniqueName(
  __in   IStorage *pstgParent,
  __in   PCWSTR pszFileSpec,
  __in   DWORD grfMode,
  __in   REFIID riid,
  __out  void **ppv
);

Parameters

pstgParent [in]

Type: IStorage*

A pointer to an IStorage object.

pszFileSpec [in]

Type: PCWSTR

The format or template for the name of the stream or storage object.

grfMode [in]

Type: DWORD

The access mode to use when opening the stream or storage object. For more information and descriptions of the possible values, see STGM Constants.

riid [in]

Type: REFIID

A reference to the IID of the interface to retrieve through ppv, typically IID_IStorage or IID_IStream.

ppv [out]

Type: void**

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

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

Minimum supported server

Windows Server 2008 R2

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 6.1 or later)

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ