Allocating Processing Time

After it has supplied the raw pen data to an HRC object, the application then allocates processing time for recognition by calling ProcessHRC. To accommodate applications with time-critical communications requirements or other CPU-intensive activities, ProcessHRC takes a time-out value (in milliseconds) as its second argument. If the time-out period elapses before ProcessHRC finishes processing, the function returns an HRCR_INCOMPLETE value. In this way, an application can repeatedly allocate small slices of time until the recognizer finishes its work.

PENWIN.H defines three time-out codes that an application can use when calling ProcessHRC. The following table describes the time-out codes.

Time-out code
Allocates the smallest possible period of time to the recognizer, approximately 50 milliseconds.
Allocates a moderate amount of time to the recognizer, approximately 200 milliseconds.
Grants the recognizer as much time as it requires to complete the recognition.

The following line allocates the default time-out period to the recognizer in the HRC identified by the handle hrc1:

iRet = ProcessHRC( hrc1, PH_DEFAULT );

Typically, AddPenInputHRC and ProcessHRC work together in a loop or in repeated response to a PE_ message as the user writes. One function continually retrieves the latest pen data while the other processes that data. When the input session terminates, an application should call ProcessHRC with PH_MAX to finalize the recognition.

See the reference section for ProcessHRC in Chapter 10 for additional information about this function. When ProcessHRC returns, the application can retrieve results from the HRC object, as described in the next section.

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