ITextHost::TxGetMaxLength method

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

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

ITextHost
Reference
EM_LIMITTEXT
Conceptual
Windowless Rich Edit Controls

 

 

Show: