IFont::get_hFont method

Retrieves a handle to the font described by this font object.

Syntax


HRESULT get_hFont(
  [out] HFONT *phFont
);

Parameters

phFont [out]

A pointer to the caller-allocated variable that receives the font handle. The caller does not own this resource and must not attempt to destroy the font.

Return value

The method supports the standard return values E_UNEXPECTED and E_OUTOFMEMORY, as well as the following values.

Return codeDescription
S_OK

The font handle was retrieved successfully.

E_POINTER

The address in the phFont parameter is not valid. For example, it may be NULL.

 

Remarks

Notes to Callers

The font object maintains ownership of the HFONT and can destroy it at any time without prior notification. If the caller needs to secure this font for a limited period of time, it can call IFont::AddRefHfont and IFont::ReleaseHfont.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OCIdl.h

IDL

OCIdl.idl

IID

IID_IFont is defined as BEF6E002-A874-101A-8BBA-00AA00300CAB

See also

IFont
IFont::AddRefHfont
IFont::ReleaseHfont

 

 

Show: