Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Peoblem releasing the event handler?

Peoblem releasing the event handler?

Scheduled Pinned Locked Moved C#
helpquestionannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khoramdin
    wrote on last edited by
    #1

    Hello everyone, I am trying to add the Speech Recognission into my Windows Application. I have added a button which activates the Speech Recognission once it is clicked by assigning two Event Handeler shown bellow: // Get an insance of RecoContext "Using Shared RecoContext". objRecoContext = new SpeechLib.SpSharedRecoContext(); // Assign an eventhandler for the Hypothesis Event. objRecoContext.Hypothesis += new _ISpeechRecoContextEvents_HypothesisEventHandler(Hypo_Event); // Assign an eventhandler for the Recognition Event. objRecoContext.Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(Reco_Event); Now I would like to add a button to Disable the Speech Recognission. Can someone be kind enough to tell me how I can do this? I tried the following code in order to release the event handler but it is not doing it. //code to realease the event handler objRecoContext = null; Thank you so much for your help and have a great day. Khoramdin

    C 1 Reply Last reply
    0
    • K Khoramdin

      Hello everyone, I am trying to add the Speech Recognission into my Windows Application. I have added a button which activates the Speech Recognission once it is clicked by assigning two Event Handeler shown bellow: // Get an insance of RecoContext "Using Shared RecoContext". objRecoContext = new SpeechLib.SpSharedRecoContext(); // Assign an eventhandler for the Hypothesis Event. objRecoContext.Hypothesis += new _ISpeechRecoContextEvents_HypothesisEventHandler(Hypo_Event); // Assign an eventhandler for the Recognition Event. objRecoContext.Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(Reco_Event); Now I would like to add a button to Disable the Speech Recognission. Can someone be kind enough to tell me how I can do this? I tried the following code in order to release the event handler but it is not doing it. //code to realease the event handler objRecoContext = null; Thank you so much for your help and have a great day. Khoramdin

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I thought you could use -= to remove an event handler ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      K 1 Reply Last reply
      0
      • C Christian Graus

        I thought you could use -= to remove an event handler ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        K Offline
        K Offline
        Khoramdin
        wrote on last edited by
        #3

        Hello Christian, You were correct. I tried it with " -= " and it worked. I must have been on a different planet, mate. Thank you so much for your help. Khoramdin

        A 1 Reply Last reply
        0
        • K Khoramdin

          Hello Christian, You were correct. I tried it with " -= " and it worked. I must have been on a different planet, mate. Thank you so much for your help. Khoramdin

          A Offline
          A Offline
          abalfazl
          wrote on last edited by
          #4

          Salam Aghayeh khorramdin! May you explian which function do you use in order to define speech? May I know your email?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups