'System.Windows.Forms.AxHost+InvalidActiveXStateException'
using AgentObjects; namespace speechRecognizerTest1 { public partial class Form1 : Form { private AxAgentObjects.AxAgent activeXagent = new AxAgentObjects.AxAgent(); private IAgentCtlCharacterEx Character; public Form1() { InitializeComponent(); } protected void AxAgent_Command(object sender, AxAgentObjects._AgentEvents_CommandEvent e) { IAgentCtlUserInput ui; ui = (IAgentCtlUserInput)e.userInput; if (ui.Name == "Hello") { Character.Speak((object)"Hello. My name is Robby." + " Pleased to meet you.", null); } if (ui.Name == "Goodbye") { Character.Speak((object)"It was nice talking to" + " you. Goodbye.", null); Character.Play("Wave"); Character.Play("Hide"); } } private void button1_Click(object sender, EventArgs e) { activeXagent.Characters.Load("Genie", (object)"D:\\WINDOWS\\msagent\\chars\\Genie.acs"); // THIS PART I AM GETTING EXCEPTION Character = activeXagent.Characters["Genie"]; Character.LanguageID = 0x409; Character.Show(null); Character.Speak ("Welcome you sir VISIT www.onlinecsharpteach.netfirms.com", null); button1.Enabled = false; Character.Commands.Caption="helloword"; Character.Commands.Add("Hello", (object)"Say Hello", (object)"([say](hello | hi) | good (day | morning | evening))", (object)true, (object)true); } } }
Abdullahomaid477
public Form1() { InitializeComponent(); this.Controls.Add(activeXagent); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)