Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ISpLexicon::GetGeneration (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

ISpLexicon::GetGeneration

ISpLexicon::GetGeneration passes back the generation ID for a word.


Passes back the current generation ID of the user lexicon. It is used to detect the changes in the user lexicon because each change in the user lexicon (add/remove a word or install/uninstall an application lexicon) will increment the generation ID.

HRESULT GetGeneration(
   DWORD   *pdwGeneration
);

Parameters

pdwGeneration
The generation ID. This is a relative count of how many times the custom lexicons have changed.

Return values

ValueDescription
S_OKFunction completed successfully.
E_POINTERpdwGeneration is not a valid write pointer.
SPERR_UNINITIALIZEDInterface is not initialized.
FAILED(hr)Appropriate error message.

Remarks

ISpLexicon::GetGenerationChange and ISpLexicon::GetGeneration can be used when an application wants to determine what it has been done to the lexicon over a given period of time. That is, it can back out of changes it has made due to a user cancel. To do this before it begins modifying the lexicon, the application would call ISpLexicon::GetGeneration and store the generation ID. Later, when the application wants to see what words in the lexicon it has modified, it would call ISpLexicon::GetGenerationChanges with the stored ID. This can only be done for small changes, as SPERR_LEX_VERY_OUT_OF_SYNC will be returned once sufficient changes have been made.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.