Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Agent instantiation without adding ole control to for
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00395572
Message ID:
00395619
Views:
7
>>Okee, I got so far. In the command window i was able to create the object and make him do stuff.
>>
>>loDgs = createobject("Agent.Control.2")
>>
>>loDgs.Connected = .T.
>>
>>loDgs.Characters.Load("Merlin","c:\WINNT\MSAGENT\CHARS\MERLIN.ACS")
>>
>>loGuy = loDgs.Characters("Merlin")
>>
>>loGuy.Speak("This is a test")
>>
>>This works, but when I put this code in a prg and try to run it, nothin happens.... WTH?
>>
>>George
>
>Hmm, this version works from .PRG fine.
>
>public lodgs
>loDgs = createobject("Agent.Control.2")
>loDgs.Connected = .T.
>loDgs.Characters.Load("Merlin","c:\WINNT\MSAGENT\CHARS\MERLIN.ACS")
>loGuy = loDgs.Characters("Merlin")
>loGuy.Show()
>loGuy.Speak("This is a test")
>
>Why do you want the Agent to be a separate object?
>Another idea - you can subclass the oleAgent and add it to _screen object (not tested yet)

I think what happened there - if you didn't have loDgs as public variable - it went out of scope just before Merlin was going to open his mouth. :)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform