Freigeben über


SetFactoid Function

SetFactoid Function

Specifies the factoid a recognizer uses to constrain its search for the result.

You specify a factoid if an input field is of a known type, such as if the input field contains a date. You call this function before processing the ink for the first time. Therefore, call the SetFactoid function before calling the Process function.

Syntax

[C++]

HRESULT WINAPI SetFactoid(
  HRECOCONTEXT hrc,
  ULONG cwcFactoid,
  const WCHAR *pwcFactoid
);

Parameters

hrc

[in] Handle to the recognizer context.

cwcFactoid

[in] Number of characters in pwcFactoid.

pwcFactoid

[in] Identifies the factoid to use on the recognizer context. The string is not NULL-terminated.

Return Value

HRESULT value Description
S_OK Success.
TPC_E_INVALID_PROPERTY The specified factoid is not supported.
TPC_E_OUT_OF_ORDER_CALL You must call the SetFactoid function before calling the Process function.
E_POINTER The context is invalid or one of the parameters is an invalid pointer.
E_NOTIMPL The recognizer does not support this function.
E_OUTOFMEMORY Unable to allocate memory to complete the operation.
E_FAIL An unspecified error occurred.
E_INVALIDARG The context contains an invalid value.

Remarks

For a list of factoids that can be passed in the cwcFactoid parameter, see Supported Factoids from Version 1. The DEFAULT factoid listed in that topic is not a valid value to pass to SetFactoid; the Tablet PC Platform API's internally convert DEFAULT to NULL before calling the SetFactoid function.

It is recommeded that you limit the length of the factoid string to no more than 32768 characters.

See Also