Partager via


AdviseInkChange Function

AdviseInkChange Function

Stops the recognizer from processing ink because a stroke has been added or deleted.

Syntax

[C++]

HRESULT WINAPI AdviseInkChange(
  HRECOCONTEXT hrc,
  BOOL bNewStroke
);

Parameters

hrc

[in] Handle to the recognizer context.

bNewStroke

[in] TRUE if adding a new stroke. Set to FALSE if strokes were erased, split, merged, extracted, or deleted from the Ink object.

Return Value

HRESULT value Description
S_OK Success. This function also returns S_OK if the recognizer does not support this function.
E_POINTER One of the parameters is an invalid pointer.
E_FAIL An unspecified error occurred.

Remarks

The AdviseInkChange function signals that there will be additional calls to the AddStroke function. This enables any recognition already in progress to stop at any convenient point. Recognition completion is one such point, so AdviseInkChange can safely do nothing.

For example, if you have two threads, one thread may be using AddStroke and Process with other functions to obtain results. The other thread may be collecting ink, echoing it, and queuing tasks for the first thread. The second thread calls AdviseInkChange to notify the recognizer a change is coming. This enables the first thread to return to the caller sooner than without the call to AdviseInkChange. The first thread can then call the recognizer again with more ink.

If you set the bNewStroke parameter to FALSE because a stroke was modified or deleted, also call the ResetContext function, and then call the AddStroke function to add the strokes from the InkDisp object to the recognizer context. This is done automatically if you attach the recognizer context to the InkDisp object.