ITfRange::GetText method (msctf.h)

The ITfRange::GetText method obtains the content covered by this range of text.

Syntax

HRESULT GetText(
  [in]  TfEditCookie ec,
  [in]  DWORD        dwFlags,
  [out] WCHAR        *pchText,
  [in]  ULONG        cchMax,
  [out] ULONG        *pcch
);

Parameters

[in] ec

Edit cookie that identifies the edit context obtained from ITfDocumentMgr::CreateContext or ITfEditSession::DoEditSession.

[in] dwFlags

Bit fields that specify optional behavior.

Value Meaning
TF_TF_MOVESTART
Start anchor of the range is advanced to the position after the last character returned.
TF_TF_IGNOREEND
Method attempts to fill pchText with the maximum number of characters, instead of halting the copy at the position occupied by the end anchor of the range.

[out] pchText

Pointer to a buffer to receive the text in the range.

[in] cchMax

Maximum size of the text buffer.

[out] pcch

Pointer to a ULONG representing the number of characters written to the pchText text buffer.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_FAIL
An unspecified error occurred.
E_INVALIDARG
One or more parameters are invalid.
TF_E_NOLOCK
The value of the ec parameter is an invalid cookie, or the caller does not have a read-only lock.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header msctf.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

ITfDocumentMgr::CreateContext

ITfEditSession::DoEditSession

ITfRange

TF_TF_* Constants

Text Stores