Export (0) Print
Expand All

ITextServices::TxGetText method

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 codeDescription
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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Textserv.h

DLL

Msftedit.dll

See also

ITextServices
Reference
GetText
Conceptual
Windowless Rich Edit Controls
Other Resources
WM_GETTEXT

 

 

Community Additions

ADD
Show:
© 2014 Microsoft