ITextServices::TxSetText method

Sets all of the text in the control.

Syntax


HRESULT TxSetText(
  [in] LPCTSTR pszText
);

Parameters

pszText [in]

Type: LPCTSTR

The string which will replace the current text.

Return value

Type: HRESULT

If the method succeeds, the return value is S_OK.

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

Return codeDescription
E_FAIL

Text could not be updated.

 

Remarks

This method should be used with care; it essentially reinitializes the text services object with some new data. Any previous data and formatting information will be lost, including undo information.

If previous data has been copied to the clipboard, that data will be rendered completely to the clipboard (through OleFlushClipboard) before it is discarded.

This method does not support Undo.

Two alternate approaches to setting text are WM_SETTEXT and SetText.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Textserv.h

DLL

Msftedit.dll

See also

ITextServices
Reference
SetText
Conceptual
Windowless Rich Edit Controls
Other Resources
OleFlushClipboard
WM_SETTEXT

 

 

Show: