ITextServices::TxGetText method (textserv.h)

Returns all of the Unicode plain text in the control as a BSTR.

Syntax

HRESULT TxGetText(
  BSTR *pbstrText
);

Parameters

pbstrText

Type: BSTR *

The Unicode plain text.

Return value

Type: HRESULT

If the text is successfully returned in the output argument, the return value is S_OK.

If the method fails, the return value is one of the following HRESULT codes. For more information on COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
Invalid BSTR pointer passed in.
E_OUTOFMEMORY
Could not allocate memory for copy of the text.

Remarks

The host (caller) takes ownership of the returned BSTR.

Other ways to retrieve plain text data are to use WM_GETTEXT or the Text Object Model (TOM) GetText method.

If there is no text in the control, the BSTR is allocated and 0x000D is returned in it.

The returned text will not necessarily be null-terminated.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header textserv.h
DLL Msftedit.dll

See also

Conceptual

GetText

ITextServices

Other Resources

Reference

WM_GETTEXT

Windowless Rich Edit Controls