ISpLexicon::GetGeneration (SAPI 5.3)

Microsoft Speech API 5.3


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


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

Return values



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.