|
-
Nov 22nd, 2000, 10:53 AM
#1
Thread Starter
Member
Hey everybody,
Does anyone know how to declare an instance of MS Agent just code? I don't want to use the MS agent control if I don't have to I've looked on Microsoft's site for answers to this one, and couldn't find anything helpful to me.
Thanks in advance for your help!
The surfer!
[email protected]
There come's a time in the affairs of a man when he must take the bull by the tail and face the situation.
- W. C. Fields
-
Nov 22nd, 2000, 12:44 PM
#2
Fanatic Member
As dictated by Karl Moore:
1] Create a new Visual Basic project
2] Click 'Project', 'References'
3] Find and select 'Microsoft Agent Control 2.0'
4] Create the following public variables in the 'General Declarations' section behind your Form:
Code:
Dim WithEvents CoreAgent As Agent
Dim Assistant As IAgentCtlCharacterEx
5] Add a Command Button to Form1
6] Change it's Caption to "Initialise Agent"
7] Insert the following code behind the Command Button:
Code:
Set CoreAgent = New Agent
CoreAgent.Characters.Load "Assistant"
Set Assistant = CoreAgent.Characters("Assistant")
The only way to access MSAgent is through the control. You can either add it to the references of your project or add the MSAgent component to your components list. I believe this is the better way to do it as you do not need a form to use the agent.
-
Nov 22nd, 2000, 01:08 PM
#3
Thread Starter
Member
Thanks for the help! I think I'll see if I can add this to a wrapper class now so I don't need a form at all
The surfer!
[email protected]
There come's a time in the affairs of a man when he must take the bull by the tail and face the situation.
- W. C. Fields
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|