This function adds a word to an internal or external user dictionary.
At a Glance
Header file: | Splapi.h |
Windows CE versions: | 2.10 and later |
Syntax
int SplAddUserDict( HSPL hspl, int nID, const WCHAR * pwszAdd,
const WCHAR * pwszChange );
Parameters
hspl
Handle to the spelling session. An application initiates a spelling session by calling the SplInit function, which then generates this handle.
nID
Identifier of the spelling dictionary.
pwszAdd
Pointer to a string that contains the word to add.
pwszChange
Pointer to a string that contains the word that replaces the incorrect word. If nID is either SPL_CHANGE_ALWAYS_LEX or SPL_CHANGE_ONCE_LEX, this parameter points to the word that replaces the word pwszAdd points to. Otherwise, this parameter is NULL.
Return Values
1 indicates success. 0 indicates failure.
Remarks
The internal dictionaries SPL_CHANGE_ALWAYS_LEX and SPL_CHANGE_ONCE_LEX support automatic substitution for a word in their lists—for example, “ISV” can be changed to “independent software vender.” When adding a word to either of these dictionaries, include the incorrect word in pwszAdd and the correct word in pwszChange.
For the SPL_IGNORE_LEX internal dictionary, pwszAdd points to the word to ignore and pwszChange is set to NULL.
Internal user dictionaries are created as empty word lists when an application calls SplInit to start a spelling session. External user dictionaries are typically created by the user and saved for use during future spelling sessions when an application calls the SplQuit function. During a spelling session, applications can edit internal and external user dictionaries by using SplAddUserDict to add words, using SplRemUserDict to remove words, and using SplClrUserDict to clear all entries in an internal or external user dictionary.
To create an external user dictionary, specify the path to the new dictionary to with a call to the SplInit function. To base the contents of the new dictionary on an existing external user dictionary, specify that dictionary in the SplInit call as well and use the SplEnumUserDict function to capture the contents of the existing dictionary. An application uses this output to display the contents to a user, who interacts with an application to modify the contents. To place words from a modified word list in the new dictionary, an application calls SplAddUserDict. The new external user dictionary is saved when the application calls SplQuit.
See Also
SplClrUserDict, SplEnumUserDict, SplInit, SplRemUserDict, SplSizeUserDict