COleControl::GetFontTextMetrics

void GetFontTextMetrics( LPTEXTMETRIC lptm, CFontHolder& fontHolder );

Parameters

lptm

Pointer to a TEXTMETRIC structure.

fontHolder

Reference to a CFontHolder object.

Remarks

Call this function to measure the text metrics for any CFontHolder object owned by the control. Such a font can be selected with the COleControl::SelectFontObject function. GetFontTextMetrics will initialize the TEXTMETRIC structure pointed to by lptm with valid metrics information about fontHolder's font if successful, or fill the structure with zeros if not successful. You should use this function instead of ::GetTextMetrics when painting your control because controls, like any embedded OLE object, may be required to render themselves into a metafile.

The TEXTMETRIC structure for the default font is refreshed when the SelectFontObject function is called. You should call GetFontTextMetrics only after selecting the stock Font property to assure the information it provides is valid.

COleControl OverviewClass MembersHierarchy Chart