Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content


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;


A pointer to the character string to process.


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.


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.


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


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.


A pointer to a CString object to process.

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.

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

Header: afxwin.h

© 2015 Microsoft