Nuo writes:
Windows Mobile Ink: The Correct Way of Getting Recognition Results
Windows Mobile Ink APIs are new in Windows Mobile 6 SDK. I guess they are trying to replace the old RichInk APIs.
The way of using Windows Mobile Ink is not complex. The basic idea is to have a IInkOverlay object as an ink collector; an IInkDisp object as a container of strokes data; an IInkStrokes object as a collection of IInkStrokeDisp object. The IInkOverlay object collects the ink data and put them in the IInkDisp object. Then the IInkDisp object sends the strokes to the IInkStrokes object.
When the strokes data are in the IInkStrokes object, it's time to get the best recognition result. Currently there are two ways of doing that. One is to directly use the ToString() method to get the best recognition result; the other is to create an IInkRecognitionResult object and use the get_RecognitionResult property to get the recognition result set from the IInkStrokes object, then use get_TopString() property to get the best fit result and put it in the BSTR.
/*** pInkStrokes is the IInkStrokes object. * pInkRecognitionResult is the IInkRecognitinoResult object. * StringRecognitionResult is the BSTR.**/
//Get the best recognition result to the IInkRecognitionResult objectpInkStrokes->get_RecognitionResult(&pInkRecognitionResult);//Get the best recognition result to the BSTRpInkRecognitionResult->get_TopString(&StringRecognitionResult);
The first way, using ToString(), seems to be much easier than the second way which is to use IInkRecognitionResult object; However, ToString() is not recommended in this case. I've even mistakenly used ToString() and had some strange exceptions raised (e.g. WinCE501bException) when my application is not used properly. The correct way of getting ink recognition results is to use IInkRecognitionResult object and its properties.