CDC::GetCharacterPlacement

Retrieves various types of information on a character string.

DWORD GetCharacterPlacement(
   LPCTSTR lpString,
   int nCount,
   int nMaxExtent,
   LPGCP_RESULTS lpResults,
   DWORD dwFlags
) const;
DWORD GetCharacterPlacement(
   CString& str,
   int nMaxExtent,
   LPGCP_RESULTS lpResults,
   DWORD dwFlags
) const;

Parameters

  • lpString
    A pointer to the character string to process.

  • nCount
    Specifies the length of the string. For the ANSI version, it is a BYTE count and for the Unicode function it is a WORD count. For more information, see GetCharacterPlacement.

  • nMaxExtent
    Specifies the maximum extent (in logical units) to which the string is processed. Characters that, if processed, would exceed this extent are ignored. Computations for any required ordering or glyph arrays apply only to the included characters. This parameter is used only if the GCP_MAXEXTENT value is specified in the dwFlags parameter. As the function processes the input string, each character and its extent is added to the output, extent, and other arrays only if the total extent has not yet exceeded the maximum. Once the limit is reached, processing will stop.

  • lpResults
    Pointer to a GCP_Results structure that receives the results of the function.

  • dwFlags
    Specifies how to process the string into the required arrays. This parameter can be one or more of the values listed in the dwFlags section of the GetCharacterPlacement topic.

  • str
    A pointer to a CString object to process.

Return Value

If the function succeeds, the return value is the width and height of the string in logical units.

If the function fails, the return value is zero.

Remarks

This member function emulates the functionality of the function GetCharacterPlacement, as described in the Windows SDK.

Requirements

Header: afxwin.h

See Also

Reference

CDC Class

Hierarchy Chart

CDC::ExtTextOut

CDC::GetCharABCWidths

CDC::GetTextMetrics