Thanks Steve...that might be part of the problem but I can't tell. Adding
"WithEvents" on the declartion line didn't make any difference so I don'
know. Maybe there's more to the WithEvent qualifier that I don't understand.
> Thanks Steve...that might be part of the problem but I can't tell.
> Adding "WithEvents" on the declartion line didn't make any difference
> so I don' know. Maybe there's more to the WithEvent qualifier that I
> don't understand.
I just noticed this:
Private Sub Agent_IdleStart(ByVal Merlin As Object, ByVal e As
AxAgentObjects._AgentEvents_IdleStartEvent) Handles Agent.IdleStart
Merlin.Speak("Good Bye!")
End
End Sub
Handles Agent.IdleStart. Hmm, you have no object by the name of Agent.
I think you need to do
Public WithEvents ctlAgent As New AgentObjects.Agent
and then do
Private Sub Agent_IdleStart(ByVal Merlin As Object, ByVal e As
AxAgentObjects._AgentEvents_IdleStartEvent) Handles ctlAgent.IdleStart
Merlin.Speak("Good Bye!")
End
End Sub
Or just play around with it. You need to work out which object raises the event,
then declare that one WithEvents, then handle an event from that object. If it
is Merlin, then handle Merlin.IdleStart. Etc.
Dvanwig - 10 Mar 2008 03:18 GMT
Thank you Steve,
Your suggestion solved the problem. It turns out it was ctlAgent that was
sending the StartIdle event and so I needed the "WithEvents" qualifier and a
new subroutine to refer to it. Then everything works fine. Thank you again
very much.
Dvanwig in Illinios
> > Thanks Steve...that might be part of the problem but I can't tell.
> > Adding "WithEvents" on the declartion line didn't make any difference
[quoted text clipped - 26 lines]
> then declare that one WithEvents, then handle an event from that object. If it
> is Merlin, then handle Merlin.IdleStart. Etc.