SetGlobalRC 

1.0     2.0     

Sets the current default settings for the global RC232HBHC structure. In version 2.0 of the Pen API, the RC structure is made obsolete by the HRC object.

 

Note  This function is provided only for compatibility with version 1.0 of the Pen API and will not be supported in future versions.

 

UINT SetGlobalRC( LPRC lprc, LPSTR lpszDefRecog, LPSTR lpszDefDict )

Parameters

lprc

Address of an RC232HBHC structure or NULL.

lpszDefRecog

Address of string specifying the name of the default recognizer module (maximum 128 bytes).

lpszDefDict

Address of a string specifying the default dictionary path. The list should end with two null characters.

Return Value

Returns the value SGRC_OK if successful. If an error occurs, the return value consists of one or more of the following values, combined using the bitwise-OR operator.

Constant

Description

SGRC_USER

An invalid user name was found in the supplied RC232HBHC structure. The call to SetGlobalRC has no effect.

SGRC_PARAMERROR

One or more invalid parameters were detected. The call to SetGlobalRC has no effect.

SGRC_RC

The supplied recognition context lprc has entries, other than the user name, that contain invalid settings for a global recognition context. The supplied recognition context is ignored.

SGRC_RECOGNIZER

The supplied recognizer module name lpszDefRecog is invalid or the recognizer cannot be loaded. The supplied recognizer module name is ignored.

SGRC_DICTIONARY

The supplied dictionary path lpszDefDict is invalid or some dictionaries on the path cannot be loaded. The supplied dictionary path is ignored.

SGRC_INIFILE

An error was encountered while saving the new global recognition context settings to the pen section of the system registry. The new settings are lost after rebooting Windows.

 

Comments

Because the default RC232HBHC values are shared among all version 1.0 applications running, the values should be changed only through the Control Panel. Whenever a change is made to the global RC values, the WM_PENMISCINFO message is sent to all top-level windows. The wParam and lParam values are not used, and they are set to 0.

Any of the parameters can be NULL to indicate that the calling application does not want the value changed.

SetGlobalRC uses only the following members of the RC structure pointed to by the lprc parameter:

clErrorLevel lPcm (PCM_TIMEOUT and PCM_RANGE bits)  lpLanguage lpUser nInkWidth rgbInk wCountry wIntlPreferences wRcDirect wRcPreferences wTimeOut wTryDictionary

When InitRC1AOBZ. is called for a new recognizer from within the SetGlobalRC call, the RC232HBHC structure that is passed in contains the new values for all members except hrec and rglpdf. No new recognizer and dictionaries have been set up at this point.

When a version 1.0 application receives a WM_PENMISCINFO message, it should call ConfigRecognizer232HADD with a WCR_RCCHANGE subfunction request. This should be done for all recognizers that the application has loaded, excluding the default recognizer. The RC Manager calls ConfigRecognizer in the new default recognizer with a WCR_RCCHANGE subfunction request.

SetGlobalRC does not save the RCP_MAPCHAR flag in the wRcPreferences member of the RC structure to the system registry. The RCP_MAPCHAR flag is reflected in the global RC for the current session only.

See Also

InitRC, GetGlobalRC, RC