IInkRecognitionResult::ModifyTopAlternate method (msinkaut.h)

Changes the top alternate of a recognition result by using the specified alternate.


HRESULT ModifyTopAlternate(
  [in] IInkRecognitionAlternate *Alternate


[in] Alternate

The IInkRecognitionAlternate to use to modify the top alternate.

Return value

This method can return one of these values.

Return code Description
The lattice does not contain data.
A parameter contained an invalid pointer.
The alternate does not match the known range, or it was not obtained from this lattice.
An exception occurred while processing.
Cannot allocate memory to complete the operation.


By default, the best result string of the recognition result corresponds to the top alternate. However, you can use this method to specify that alternates other than the top alternate are used in the result. When you choose an alternate other than the top alternate, you are essentially choosing a different path through the lattice of alternates that are associated with the results.

To retrieve the alternates that can be used to modify the recognition result, call the AlternatesFromSelection method.

Note  A call to ModifyTopAlternate Method may modify the TopString and TopAlternate properties.
The alternate used in the function can be a word alternate in an entire sentence. For example, an alternate obtained by using AlternatesFromSelection (0, 5) for "Hello World" only changes the "Hello" part of the word leaving the "World" part intact.


Minimum supported client Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header msinkaut.h
Library InkObj.dll

See also

GetAlternatesFromSelection Method

IInkRecognitionAlternate Interface

IInkRecognitionResult Interface

TopAlternate Property

TopString Property