Programming MSAgent in VB Express 2008

D

Dvanwig

Trying to get started programming MSAgent using Visual Basic 2008 Express. I
have VB6 working code, but cannot figure out the new syntax for setting up
the initial declarations to get MSAgent working. Can somebody get me started
with a simple Form with a textbox and a button where if the user clicks the
button, Merlin will popup and say whatever is in the text box? I'll expand
from there. Thanks a bunch.
 
D

Dvanwig

Hello Eric,
Thanks for your help. I have Merlin popping up now and speaking. However,
I have a problem where my code will not respond to an idlestart event. Here
is a simple code sample that will not fire the subroutine when Merlin enters
an idle state. Can you tell me what's wrong and why?

Thanks again for your help.

Doug vW

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top