Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Microsoft Agent !

Posted on 1999-07-15
9
Medium Priority
?
590 Views
Last Modified: 2012-08-13
microsoft agent is like an office assistant on microsoft office 97.

is there any body has made a program use microsoft agent,
please tell me how to use and code it ?


fyi: i'm using delphi 4
0
Comment
Question by:herman78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 1000 total points
ID: 1388861
Hi
i found out this info for ya:
Once you import the Type library into Delphi you can use code completion and view the definitions for the types.  You may want to look at COM programming to understand this.  Basically IMPORT the agent into delphi.  This will give you a non-visual component called TAgent to place on a form.  From here you access the relevent objects to make the agent do what you want.....Here is the code from a form that does some stuff...not well documented but it is to get you learning with.
 
unit frmMerlin;
 
interface
 
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,   Dialogs, ComObj, StdCtrls, AgentObjects_TLB, OleCtrls, HSRLib_TLB;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    AgentCtl: TAgent;
    Vcommand1: TVcommand;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure AgentCtlCommand(Sender: TObject; const UserInput: IDispatch);   private
    { Private declarations }
//    myAgent : IAgentCtlCharacter;
    myAgent : IAgentCtlCharacter;
    AgentController: IAgentCtlEx;
    {AgentController: Agent;}
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
const
  AGENT_PATH_MERLIN = 'c:\WINNT\MSAGENT\CHARS\MERLIN.ACS';
 
implementation
 
{$R *.DFM}
 
procedure TForm1.FormCreate(Sender: TObject);
Var
  Characters : IAgentCtlCharacters;
begin
    //AgentController := CreateOleObject('Agent.Control.1');
//    AgentCtl := TAgent.Create(self);
    AgentController := AgentCtl.ControlInterface;
    AgentController.Connected := TRUE;
    Characters := AgentController.Characters;
    Characters.Load ('merlin', AGENT_PATH_MERLIN);
    myAgent := Characters.Character( 'merlin');
 
    myAgent.Show(0);
    myAgent.MoveTo(10, 10, 1);
//    myAgent.Get('state', 'Speaking', 1);
//    myAgent.Speak('Hello there master, how may I help?', ''); //    myAgent.Play( 'Search');
    myAgent.Commands.GlobalVoiceCommandsEnabled := True;
    myAgent.Commands.VoiceCaption := 'Greg Nuttall';
//    AgentController.PropertySheet.Visible := True;
    myAgent.Commands.Add( 'properties', 'properties', 1, True, True);     myAgent.Commands.Add( 'greg', 'say hello', 1, True, True);
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
    myAgent.MoveTo(270,200, 0);
    myAgent.Speak(Edit1.Text, '');
end;
 
procedure TForm1.AgentCtlCommand(Sender: TObject;
  const UserInput: IDispatch);
begin
  If IAgentCtlUserInput( UserInput).Name = 'greg' then
  begin
    myAgent.Play('Announce');
    myAgent.Get('state', 'Speaking', 1);
    myAgent.Speak('Hello Jacquie', '');
  end;
  If IAgentCtlUserInput( UserInput).Name = 'properties' then
      AgentController.PropertySheet.Visible := True;
 
end;
 
end.

There is going to be a article on the subject coming out in Delphi Informant later this year so you may want to subscribe to that ,the article will be by Eddie Shipman
see: http://www.informant.com/delphi/ if you want to subscribe,it is a good mag.
hope all that gibes some help ;-)
Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 1388863
also some component that may be of interest here:

http://dsp.href.com/iis/iis.dll?DSP:RESULTS:942100659
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:inthe
ID: 1388864
<snap> same components + 1  :-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388865
:-) yup one more
0
 
LVL 17

Expert Comment

by:inthe
ID: 1388866
i tried the above link again and it dont work this time??? so i add the extra component url here
there were 3 more but the same as meikls.

http://sunsite.icm.edu.pl/delphi/ftp/d10free/bmassist.zip
0
 
LVL 2

Expert Comment

by:CalvinDay
ID: 1388867
the www.undu.com site has had a few articles about it.
0
 
LVL 17

Expert Comment

by:inthe
ID: 1388868
0
 

Author Comment

by:herman78
ID: 1388869
Thanks !

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question