CSize GetTextExtent( const char FAR* lpString, int nCount ) const;
lpString
Points to a string of characters. You can also pass a CString object for this parameter.
nCount
Specifies the number of characters in the string.
Computes the width and height of a line of text, using the current font to determine the dimensions.
Since some devices do not place characters in regular cell arrays (that is, they carry out kerning), the sum of the extents of the characters in a string may not be equal to the extent of the string.
The dimensions of the string (in logical units).
CDC::GetTabbedTextExtent, ::GetTextExtentEx, CDC::SetTextJustification