Results 1 to 3 of 3

Thread: MS Agent (just code) ...

Hybrid View

  1. #1

    Thread Starter
    Member surfmstr's Avatar
    Join Date
    Feb 2000
    Location
    St Louis, MO USA
    Posts
    48

    Talking

    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

  2. #2
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    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.
    -Excalibur

  3. #3

    Thread Starter
    Member surfmstr's Avatar
    Join Date
    Feb 2000
    Location
    St Louis, MO USA
    Posts
    48

    Talking

    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
  •  



Click Here to Expand Forum to Full Width