IVDctText::TextSet

HRESULT TextSet (DWORD dwStart, DWORD dwNumChars,

PCTSTR pszBuf, DWORD dwReason);

TextSet replaces a text selection defined by the beginning and number of characters. The text is replaced with the new text.

The selection (see TextSelGet TextSelSet) is moved or resized by calling this. If the selection is entirely after the move location then it is moved forward/backwards by the number of inserted characters. If the text changed is within the selection then the selection is shrunk/enlarged by the number of characters removed/inserted. If the selection and the text modifications overlap the selection is not changed.

· Returns NOERROR if successful, or one of these error values:

E_INVALIDARG
E_OUTOFMEMORY

dwStart

[in] Starting character. If this exceeds the size of the buffer then an error is returned.

dwNumChars

[in] Number of characters to replace.

pszBuf

[in] NULL-terminated text string to replace the old text with.

dwReason

[in] Reason for removing the old text. It is one of the following values.

Value

Description

VDCT_TEXTCLEAN

Clears the data from the buffer without making any assumption whether or not the text was correct.

VDCT_TEXTKEEPRESULTS

Removes the text from the buffer. The results objects are all called with ISRResCorrection::Validate.