• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Resources for IT Professionals
 
 
 
Resources for IT Professionals > Forums Home > .NET Base Class Library > SpeechRecognitionEngine.LoadGrammar - COMException 8004041B
Ask a questionAsk a question
Search Forums:
  • Search .NET Base Class Library Forum Search .NET Base Class Library Forum
  • Search All Microsoft Forums Search All Microsoft Forums
 

QuestionSpeechRecognitionEngine.LoadGrammar - COMException 8004041B

  • Sunday, July 13, 2008 11:54 PMsynerynx Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

     Hi all,

    When I'm using the SpeechRecognitionEngine and make a call to LoadGrammar, I get a COMException that contains the following:

    System.Runtime.InteropServices.COMException was unhandled
      Message="Exception from HRESULT: 0x8004041B"
      Source="System.Speech"
      ErrorCode=-2147220453
      StackTrace:
           at System.Speech.Internal.SapiInterop.ISpRecoGrammar.LoadCmdFromMemory(IntPtr pGrammar, SPLOADOPTIONS Options)
           at System.Speech.Internal.SapiInterop.SapiGrammar.<>c__DisplayClass7.<LoadCmdFromMemory>b__6()
           at System.Speech.Internal.SapiInterop.SapiProxy.PassThrough.Invoke2(VoidDelegate pfn)
           at System.Speech.Recognition.RecognizerBase.LoadSapiGrammarFromCfg(SapiGrammar sapiGrammar, Grammar grammar, Uri baseUri, Boolean enabled, Single weight, Int32 priority)
           at System.Speech.Recognition.RecognizerBase.LoadSapiGrammar(Grammar grammar, SapiGrammar sapiGrammar, Boolean enabled, Single weight, Int32 priority)
           at System.Speech.Recognition.RecognizerBase.LoadGrammar(Grammar grammar)
           at System.Speech.Recognition.SpeechRecognitionEngine.LoadGrammar(Grammar grammar)
           at WindowsFormsApplication3.Form1.SetCommands(String[] commands) in G:\OptimusOne\WindowsFormsApplication3\Form1.cs:line 469
           at WindowsFormsApplication3.Form1.InitSpeechRecognitionThread() in G:\OptimusOne\WindowsFormsApplication3\Form1.cs:line 208
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:


    I haven't been able to find any documentation online about this particular COMException.  Has anyone seen this before?  Any ideas on what I could do to fix this?  It only happens on XP, not Vista.

    • ReplyReply
    • QuoteQuote
     

All Replies

  • Friday, March 27, 2009 9:36 AMLongTom89 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    After a lot of searching I finally found that code 8004041B means 'Subscript out of range' and in my code was being caused by an incorrectly dimensioned array.

    HTH

    JG
    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Manage Your Profile
|
Contact Us
|
Newsletter
|
Terms of Use
|
Trademarks
|
Privacy Statement