ISpContainerLexicon::AddLexicon (SAPI 5.3)
Microsoft Speech API 5.3
ISpContainerLexicon::AddLexicon
ISpContainerLexicon::AddLexicon adds a lexicon and its type to the lexicon stack. Mainly used by engines to add private lexicons to their instance of the container lexicon for consistency of lexicon access.
HRESULT AddLexicon(
ISpLexicon *pAddLexicon,
DWORD dwFlags
);
Parameters
- pAddLexicon
[in] Pointer to the lexicon to be added. - dwFlags
[in] flags of type SPLEXICONTYPE indicating the lexicon type. Should use exactly one of the types from eLEXTYPE_PRIVATE1 through eLEXTYPE_PRIVATE20.
Return values
Value |
S_OK |
E_INVALIDARG |
SPERR_ALREADY_INITIALIZED |
E_POINTER |
E_OUTOFMEMORY |
FAILED(hr) |
Remarks
For an application to create a new application lexicon, calling AddLexicon for the new lexicon on the application's instance of the container lexicon will not update the engine's instance of the container lexicon. The correct way to update an instance of the container lexicon is to release it and recreate the object. At this point it will re-enumerate all available application lexicons. To guarantee an update of the engine's instance of the container lexicon, the engine must be released and recreated, at which point it will recreate its instance of the container lexicon.