Freigeben über


Factoid Property

Factoid Property

Gets or sets the factoid that a recognizer uses to constrain its search for the recognition result.

Declaration

[C++]

[propput] HRESULT put_Factoid ([in] BSTR Factoid);
[propget] HRESULT get_Factoid ([out, retval] BSTR* Factoid);

[Microsoft® Visual Basic® 6.0]

Public Property Get Factoid() As String
Public Property Let Factoid(ByVal theFactoid As String)

Property Value

BSTR Returns or sets the factoid type of the recognizer context.

This property is read/write.

For more information about the BSTR data type, see Using the Automation Library.

Return Value

HRESULT value Description
S_OK Success.
TPC_E_INVALID_PROPERTY The specified factoid is not supported.
TPC_E_OUT_OF_ORDER_CALL For the InkRecognizerContext object, this property cannot be assigned after strokes have been added to the Strokes property.
E_NOTIMPL The recognizer does not support this method.
E_OUTOFMEMORY Cannot allocate memory to complete the operation.
E_FAIL An unspecified error occurred.
E_INK_EXCEPTION An exception occurred.
E_INVALIDARG The context is invalid or the parameter is an invalid pointer.
E_UNEXPECTED Unexpected parameter or property type.

Remarks

A factoid provides context for recognized ink in the context of a particular field. You specify a factoid if an input field is of a known type, for example, if the input field contains a date.

For more information about factoids and how to use them, see Improving Tablet PC Recognition Accuracy by Setting Context.

Setting the Factoid succeeds only if the InkStrokes collection is NULL (Nothing in Visual Basic 6.0). You must set the Factoid before you attach the InkStrokes collection to the InkRecognizerContext or you must set the Strokes collection to NULL and then set the Factoid (and possibly reattach the InkStrokes collection).

To ensure that ink is recognized in the correct field context, set this property before processing the ink for the first time, such as before calling the Recognize method.

Note: All factoids are case sensitive.

This property takes or returns a string parameter and not a class object of the Factoid class. The members of this class are of type string.

For the InkEdit control, this property should only be changed if the Status property returns IES_Idle.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example sets the Factoid property of a recognizer context to look for postal codes.

theRecognizerContext.Factoid = "(!IS_ADDRESS_POSTALCODE)"

Applies To