ReadFmtUserTypeStg function (ole2.h)

The ReadFmtUserTypeStg function returns the clipboard format and user type previously saved with the WriteFmtUserTypeStg function.

Syntax

HRESULT ReadFmtUserTypeStg(
  [in]  LPSTORAGE  pstg,
  [out] CLIPFORMAT *pcf,
  [out] LPOLESTR   *lplpszUserType
);

Parameters

[in] pstg

Pointer to the IStorage interface on the storage object from which the information is to be read.

[out] pcf

Pointer to where the clipboard format is to be written on return. It can be NULL, indicating the format is of no interest to the caller.

[out] lplpszUserType

Address of LPWSTR pointer variable that receives a pointer to the null-terminated Unicode user-type string. The caller can specify NULL for this parameter, which indicates that the user type is of no interest. This function allocates memory for the string. The caller is responsible for freeing the memory with CoTaskMemFree.

Return value

This function supports the standard return values E_FAIL, E_INVALIDARG, and E_OUTOFMEMORY, in addition to the following:

This function also returns any of the error values returned by the ISequentialStream::Read method.

Remarks

ReadFmtUserTypeStg returns the clipboard format and the user type string from the specified storage object. The WriteClassStg function must have been called before calling 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

See also

CoTaskMemFree

WriteFmtUserTypeStg