D
Dvanwig
Hello,
I have almost got a VB 2008 Express program working using MSAgent's Merlin
character. The character pops up and says a few words and then enters the
idle state. I can click a button on the form named btnQuit to exit the
program and that subroutine works. But I want to use the IdleStart event to
cause the program to terminate gracefully by itself if unattended. However,
my program never fires the IdleStart subroutine. Here's the coding. Can
someone tell me how to correct this program so that it will trigger the
IdleStart subroutine?
Public Class Form1
Public Merlin As AgentObjects.IAgentCtlCharacter
Public ctlAgent As New AgentObjects.Agent
Public Const DATAPATH = "C:\Windows\Msagent\Chars\Merlin.acs"
Private Sub frmMerlinForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ctlAgent.Connected = True
ctlAgent.Characters.Load("Merlin", DATAPATH)
Merlin = ctlAgent.Characters("Merlin")
Merlin.Show()
Merlin.Speak("Hello World")
End Sub
Private Sub Agent_IdleStart(ByVal Merlin As Object, ByVal e As
AxAgentObjects._AgentEvents_IdleStartEvent) Handles Agent.IdleStart
Merlin.Speak("Good Bye!")
End
End Sub
Private Sub btnQuit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnQuit.Click
End
End Sub
End Class
I have almost got a VB 2008 Express program working using MSAgent's Merlin
character. The character pops up and says a few words and then enters the
idle state. I can click a button on the form named btnQuit to exit the
program and that subroutine works. But I want to use the IdleStart event to
cause the program to terminate gracefully by itself if unattended. However,
my program never fires the IdleStart subroutine. Here's the coding. Can
someone tell me how to correct this program so that it will trigger the
IdleStart subroutine?
Public Class Form1
Public Merlin As AgentObjects.IAgentCtlCharacter
Public ctlAgent As New AgentObjects.Agent
Public Const DATAPATH = "C:\Windows\Msagent\Chars\Merlin.acs"
Private Sub frmMerlinForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ctlAgent.Connected = True
ctlAgent.Characters.Load("Merlin", DATAPATH)
Merlin = ctlAgent.Characters("Merlin")
Merlin.Show()
Merlin.Speak("Hello World")
End Sub
Private Sub Agent_IdleStart(ByVal Merlin As Object, ByVal e As
AxAgentObjects._AgentEvents_IdleStartEvent) Handles Agent.IdleStart
Merlin.Speak("Good Bye!")
End
End Sub
Private Sub btnQuit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnQuit.Click
End
End Sub
End Class