ProcessHRC

  1. 0

Gives a recognizer sufficient time for intermediate processing of pen input. A recognizer must export this function.

int ProcessHRC( HRC hrc, DWORD dwTimeMax )

Parameters

hrc

Handle to the HRC object for the recognizer.

dwTimeMax

The maximum time in milliseconds that the recognizer should process before returning from this call. This parameter can also be one of the following time-out codes:

Constant
Description
PH_MIN
The recognizer should take only a very small amount of time to process the input, typically 50 milliseconds.
PH_DEFAULT
The recognizer should take a moderate amount of time to process the input, typically 200 milliseconds.
PH_MAX
The recognizer should take as much time as required to complete recognition.

Return Value

If there are no errors, returns one of the following values:

Constant
Description
HRCR_OK
Processing is successful.
HRCR_INCOMPLETE
The recognizer is still processing the current batch of input.
HRCR_GESTURE
The recognizer has recognized a possible gesture.
This can be returned before the recognition process
is complete. If the processing completes, HRCR_COMPLETE is always returned, even for gestures.
HRCR_COMPLETE
The recognizer completed processing and does not expect any more input.

To indicate an error, ProcessHRC returns one of the following negative values:

Constant
Description
HRCR_ERROR
Invalid parameter or other error.
HRCR_MEMERR
Insufficient memory.

Comments

ProcessHRC
returns if the time specified by dwTimeMax elapses before recognition is complete.

In an operating environment that does not use threads, this function allows an application to provide some time for the recognizer to process input. By checking the return value, the application is able to monitor the progress, specifically whether a gesture is a recognition candidate. If the function returns HRCR_GESTURE, the application can call GetResultsHRC to determine whether the gesture should be acted on immediately.

Typically, the return value is HRCR_OK if the current batch of ink input has been processed by the recognizer, and HRCR_INCOMPLETE if the recognizer has not yet finished processing.

If ProcessHRC is called with PH_MAX, recognition is complete only if EndPenInputHRC has been called to notify the recognizer that no more results are expected. The return value in this case is HRCR_COMPLETE, and the application is free to get and display final results. If the application supplies further input at this point, it has the effect of canceling the EndPenInputHRC call, although this procedure is not recommended for reasons of efficiency.

However, PH_MAX may result in poorer performance, since further processing in the system is blocked until ProcessHRC returns. Instead, the application can call ProcessHRC in an idle loop or a separate thread, calling it repeatedly with smaller time allotments until the function returns HRCR_COMPLETE. Note that if a separate thread is used to finish processing, the main thread can call this function with PH_MIN from time to time to determine if processing has finished (that is, checking for the HRCR_COMPLETE return value).

The first time that ProcessHRC is called for a particular recognition context, functions that set its state cannot be used for the remainder of that context's existence. The following functions return an error if they are called before ProcessHRC returns HRCR_COMPLETE:

See Also

EndPenInputHRC
, GetResultsHRC

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database