# OleCreateFontIndirect

Creates and initializes a standard font object using an initial description of the font’s properties in a FONTDESC structure. The function returns an interface pointer to the new font object specified by caller in the riid parameter. A QueryInterface is built into this call. The caller is responsible for calling Release through the interface pointer returned.

STDAPI OleCreateFontIndirect(

FONTDESC* pFontDesc, | //Pointer to the structure of parameters for font
REFIID riid, | //Reference to the identifier of the interface
VOID** ppvObj | //Indirect pointer to the object
); |

Parameters

pFontDesc
  [in] Pointer to a caller-allocated structure containing the initial state of the font.
riid
  [in] Reference to the identifier of the interface describing the type of interface pointer to return in ppvObj.
ppvObj
  [out] Indirect pointer to the initial interface pointer on the new object. If successful, the caller is responsible to call Release through this interface pointer when the new object is no longer needed. If unsuccessful, the value of ppvObj is set to NULL.

Return Values

This function supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

S_OK
  The new font was created successfully.
E_NOINTERFACE
  The object does not support the interface specified in riid.
E_POINTER
  The address in pFontDesc or ppvObj is not valid. For example, it may be NULL.

See Also

FONTDESC