Skip to content

Latest commit

 

History

History
109 lines (86 loc) · 3.13 KB

nf-tom-itextrange2-getchar2.md

File metadata and controls

109 lines (86 loc) · 3.13 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:tom.ITextRange2.GetChar2
ITextRange2::GetChar2 (tom.h)
Gets the character at the specified offset from the end of this range.
GetChar2
GetChar2 method [Windows Controls]
GetChar2 method [Windows Controls]
ITextRange2 interface
ITextRange2 interface [Windows Controls]
GetChar2 method
ITextRange2.GetChar2
ITextRange2::GetChar2
controls.itextrange2_getchar2
tom/ITextRange2::GetChar2
controls\itextrange2_getchar2.htm
Controls
8ece8ca0-fd05-481c-9ce2-b2b7a3df354e
12/05/2018
GetChar2, GetChar2 method [Windows Controls], GetChar2 method [Windows Controls],ITextRange2 interface, ITextRange2 interface [Windows Controls],GetChar2 method, ITextRange2.GetChar2, ITextRange2::GetChar2, controls.itextrange2_getchar2, tom/ITextRange2::GetChar2
tom.h
Windows
Windows 8 [desktop apps only]
Windows Server 2012 [desktop apps only]
Msftedit.dll
Windows
19H1
ITextRange2::GetChar2
tom/ITextRange2::GetChar2
c++
APIRef
kbSyntax
COM
Msftedit.dll
ITextRange2.GetChar2

ITextRange2::GetChar2

-description

Gets the character at the specified offset from the end of this range.

-parameters

-param pChar [out]

Type: long*

The character value.

-param Offset [in]

Type: long

The offset from the end of the range. An offset of 0 gets the character at the end of the range.

-returns

Type: HRESULT

If the method succeeds, it returns NOERROR. Otherwise, it returns an HRESULT error code.

-remarks

This method differs from ITextRange::GetChar in the following ways:

  • It returns the UTF-32 character for the surrogate pair instead of the pair's lead code.
  • It gets the character code, or codes, at the specified offset from the end of the range instead of the character at the start of the range.

If the character is the lead code for a surrogate pair, the corresponding UTF-32 character is returned.

If Offset specifies a character before the start of the story or at the end of the story, this method returns the character code 0.

If the Offset value is This character is returned
0 The character at the end of the range.
Negative and accesses the middle of a surrogate pair The corresponding UTF-32 character.
Positive and accesses the middle of a surrogate pair The UTF-32 character following that pair.

-see-also

ITextRange2