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 //Address of output variable that receives the 
                // interface pointer requested in riid
);
 

Parameters

pFontDesc
[in] Address of a caller-allocated, FONTDESC structure containing the initial state of the font. This value must not be NULL.
riid
[in] Reference to the identifier of the interface describing the type of interface pointer to return in ppvObj.
ppvObj
[out] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvObj contains the requested interface pointer on the newly created font 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. Note that if pFontDesc is set to NULL, the function returns NO_ERROR.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in olectl.h.
  Import Library: Included as a resource in olepro32.dll.

See Also

FONTDESC