WriteFmtUserTypeStg function (ole2.h)

The WriteFmtUserTypeStg function writes a clipboard format and user type to the storage object.

Syntax

HRESULT WriteFmtUserTypeStg(
  [in] LPSTORAGE  pstg,
  [in] CLIPFORMAT cf,
  [in] LPOLESTR   lpszUserType
);

Parameters

[in] pstg

IStorage pointer to the storage object where the information is to be written.

[in] cf

Specifies the clipboard format that describes the structure of the native area of the storage object. The format tag includes the policy for the names of streams and substorages within this storage object and the rules for interpreting data within those streams.

[in] lpszUserType

Pointer to a null-terminated Unicode string that specifies the object's current user type. The user type value, itself, cannot be NULL. This is the type returned by the IOleObject::GetUserType method. If this function is transported to a remote machine where the object class does not exist, this persistently stored user type can be shown to the user in dialog boxes.

Return value

This function returns HRESULT.

Remarks

The WriteFmtUserTypeStg function must be called in an object's implementation of the IPersistStorage::Save method. It must also be called by document-level objects that use structured storage for their persistent representation in their save sequence.

To read the information saved, applications call the ReadFmtUserTypeStg function.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole2.h
Library Ole32.lib
DLL Ole32.dll
API set ext-ms-win-com-ole32-l1-1-3 (introduced in Windows 10, version 10.0.10240)

See also

IPersistStorage::Save

ReadFmtUserTypeStg