CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechRecoGrammar

Id Property


The Id property returns the ID assigned to the grammar when it was created.

Syntax

Set: Not available.
Get: Variant = ISpeechRecoGrammar.Id

Parts

ISpeechRecoGrammar
The owning object.
Variant
Set: (This property is read-only).
Get: A Variant variable that gets the property value.

Example

The following Visual Basic form code demonstrates the use of the ID and RecoContext properties. To run this code, create a form with the following controls:

  • Two command buttons called Command1 and Command2
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure creates a recognition context with two ISpeechRecoGrammar objects. The ISpeechRecoGrammar objects are created with ID properties of 6 and 7. The Command1 and Command2 procedures each send one of the grammar objects to the GrammarSub procedure as parameters. The GrammarSub procedure displays the ID of the grammar object parameter, and uses the parameter's RecoContext property to pause and resume the recognition context that owns the grammar.

    There is no special significance to the Id property values of 6 or 7; these values are arbitrary. Additionally, the Pause and Resume methods in the GrammarSub procedure are intended simply to show how the grammar's RecoContext property provides access to the methods and properties of the recognition context which owns the grammar.


    Option Explicit
    
    Dim RecoContext As SpeechLib.SpSharedRecoContext
    Dim objGR1 As SpeechLib.ISpeechRecoGrammar
    Dim objGR2 As SpeechLib.ISpeechRecoGrammar
    
    Private Sub Command1_Click()
        Call GrammarSub(objGR1)
    End Sub
    
    Private Sub Command2_Click()
        Call GrammarSub(objGR2)
    End Sub
    
    Private Sub Form_Load()
    
        Set RecoContext = New SpSharedRecoContext
        Set objGR1 = RecoContext.CreateGrammar(6)       'Create grammar with ID = 6
        Set objGR2 = RecoContext.CreateGrammar("7")     'Create grammar with ID = 7
    
    End Sub
    
    Private Sub GrammarSub(G As SpeechLib.ISpeechRecoGrammar)
        
        G.RecoContext.Pause     'Pause the RecoContext that owns grammar
        MsgBox G.Id             'Display the Id
        G.RecoContext.Resume    'Resume the RecoContext
    
    End Sub


    You are reading help file online using chmlib.com

    If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
    Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web