Thanks.

  Worked like a charm....

Chris

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, June 16, 1999 8:45 AM
To: Multiple recipients of list Delphi
Subject: RE: [DUG]: Microsoft Agent


Try adopting the code below. Works for me, although I have only recently
begun playing with Agents, so there may be a better approach. I should point
out that I'm using the ActiveX component as opposed to variants, therefore I
am writing code for the TAgent component's event handlers.

********************************************
public
    SomeRequest : IAgentCtlRequest;

procedure TForm1.AgentCtlCommand(Sender: TObject;
  const UserInput: IDispatch);
begin
  If IAgentCtlUserInput( UserInput).Name = 'james' then
  begin
     myAgent.Play('Announce');
     myAgent.Get('state', 'Speaking', 1);
     SomeRequest := myAgent.Speak('Hello James', '');
  end;

procedure TForm1.AgentCtlRequestComplete(Sender: TObject;
  const Request: IDispatch);
begin
  if IAgentCtlRequest( Request) = SomeRequest Then
     Close();
end;
*********************************************


> -----Original Message-----
> From: MIME :[EMAIL PROTECTED] > Sent: Tuesday, 15 June 1999 20:59
> To: [EMAIL PROTECTED]
> Subject: [DUG]: Microsoft Agent
> > > Does anyone know how to wait until the Microsoft Agent stops > talking
before
> you continue?
> > I want the agent to say something, and then I want to terminate the
> application.
> > Any ideas?
> > --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List - > [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> > >


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to