ITextHost::TxGetMaxLength method (textserv.h)

Gets the text host's maximum allowed length for the text.

Syntax

HRESULT TxGetMaxLength(
  DWORD *plength
);

Parameters

plength

Type: DWORD*

The maximum allowed text length, in number of characters. If INFINITE is returned, the text services object can use as much memory as needed to store any specified text.

Return value

Type: HRESULT

The return value is S_OK.

Remarks

When this maximum is reached, the text services object should reject any further character insertion and pasted text. TxSetText however should still accept (and set) text longer than the maximum length. This is because this method is used for binding and is critical to maintaining the integrity of the data to which the control is bound.

This method parallels the EM_LIMITTEXT message.

If the limit returned is less than the number of characters currently in the text services object, no data is lost. Instead, no edits are allowed to the text other than deletion until the text is reduced to below the limit.

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

EM_LIMITTEXT

ITextHost

Reference

Windowless Rich Edit Controls