Link to home
Start Free TrialLog in
Avatar of Darkheart
Darkheart

asked on

Using Microsoft Agents with Delphi 6.0

Hi,

i've downloaded the microsoft agents and now i will use them in a project. The main problem is that the agents doesn't support inputboxes like seen in many office-applications. So i decided to download a thirdparty package called "BalloonDialog 6.5" to have the ability of such Agent-Dialogs.
This package is written in VB and so i implemented it (equal to the agents itself) as an activeX-component.

The Dialog owns a method called "InputBalloon". Calling this method should show a input-balloon near the active agent. The implementation of the method itself looks as follows:

function InputBox(const Prompt: WideString; const Title: WideString; const Default: WideString; const oAgent: IAgentCtlCharacter; const oAgentSvr: IAgentCharacterEx;)

So i declared following variables in my main programm

...
var

  currAgent: IAgentCtlCharacter;
  currAgentEx: IAgentCharacterEx;

...

but now i get a compiler error

Undeclared Identifier "IAgentCharacterEx";

The method itself supports the IAgentCharacterEx-interface as well as the IAgentCtlCharacter-interfaced. To use one of them you only have to leave the according variable for the other interface blank. But here a further error occurs, if i only use the var currAgent in the method-calling.
The Balloon-component doesn't have a create-Method so i created it as a variant with following code:

var ABalloon: Variant;

...

ABalloon := CreateOleObject('server.Balloon');

...

So the method-calling in the programm itself looks like (according to the delphi-help for variants i leave the second interface/var blank):

...
ABalloon.InputBox('text1', 'text2', 'text3', currAgent, );
...

But after calling this method with this command i got an VisualBasic Error (Error 380).

For a few days i searched for possibilities to resolve this problem. But to find a tutorial or some examples is a hard way cause there are not much people which use the Agents with delphi.

So i would be thankfull if anyone could give me some tips (resolve of this problem or an URL to delphispecific components for the agents).

Greetings

Darkheart
Avatar of Zip58
Zip58

Hi Darkheart

Not direct a answer to your quistion, but its is mabey a idea have you al take a look to TAssistant componnent compleet freeware with sources

http://www.delphiarea.com/products/assistant/ 

Regards

Zip58
Avatar of Darkheart

ASKER

Hi Zip58,

yes, i have. But i've found no usable characters and no websites where i can download characters for free. Do you know about some websites where i can get such characters?

Greetings

Darkheart
Hi Darkheart

For the moment i d'ont kwow sites where you can download characters.

I have found this also a problem so i think i will desigen my own characters.

Regards

Zip58
anAkin,

thanx for the link. But the demo itself shows only how to make the agents akt. But i need a further more possibility to show input-boxes similiar to those used in microsoft office and to make the user able to interact with the agent over the Keyboard and mouse.

Greetings

Darkheart
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
there is an Agent, web ring called "Microsoft Agent Ring" that I used to be in at

http://www.msagentring.org/

it has some free agents at

http://www.msagentring.org/chars/

another free agent place is

http://www.talkingbuddy.com/buddies.htm?k=microsoft_agent

and another

http://www.e-clips.com.au/index.cfm?type=dsp_products&scid=13

and it is not so easy to create your own charater, ,  you will need computer Graphic animation Creation skills. . . but the MS agent creation software is not so difficult to use
Hi Slick,

it would be thankfull if you can give me the code. Otherwise i found no corresponding component on the web for delphi. So i think, if some one helps me, we should test and check the VS-Component (BalloonDialog, which i mentioned before in the problemdescribtion) to use it in delphi as activeX-component. It is specially written for the agents to show a enhanced balloon-dialog and has all what is needed to make input over the keyboard available.

I've successfully installed it in delphi only the Error-Message stays and so i will be hopefull to resolve this.

Greetings

Darkheart
Yeeeeeeessssssss! I got it. The work of about 3 days is done! The box is running and i can use it in delphi !!!!

There had been a several bugs but now at the end its working really fine !
you might look at this page at EE for some code I have done for a sample MS Agent program

https://www.experts-exchange.com/questions/20426843/Getting-ms-agent-to-compile-into-delphi-6-app.html

it has Pedy read some text from a memo line by line, and shows how to use the AgentRequestComplete( ) to get your Agents to signal when a Request is compleate and scencronnize two or more agents


here is a button click to show the info form - Form2


procedure TfrmAgent.sbut_PeedyPosClick(Sender: TObject);
var
Pdtop, PdLeft: SmallInt;
begin
PdTop := Peedy.Get_Top;
PdLeft := Peedy.Get_Left;
if PdTop > 90 then
Form2.Top := PdTop - 90 else
Form2.Top := PdTop+130;
if PdLeft > -1 then
Form2.Left := PdLeft else
Form2.Left := 0;
Form2.Show;
Peedy.Speak('The Baloon Position, This is Top,., '+IntToStr(PdTop)+',., This is Left,., '+IntToStr(PdLeft),'');
end;


and some code for the Info Form , which has one TEdit and One button - the Finish button


unit baloon;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TForm2 = class(TForm)
    but_Finished: TBitBtn;
    Edit1: TEdit;
    Label1: TLabel;
    procedure but_FinishedClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.DFM}

uses newAgen1;

procedure TForm2.but_FinishedClick(Sender: TObject);
begin
Hide;
frmAgent.Peedy.Speak('Your Name is,., '+Edit1.Text,'');
end;

procedure TForm2.FormCreate(Sender: TObject);
var
hRgn: Integer;
begin
hRgn := CreateEllipticRgn(0,0,Width, Height);
SetWindowRgn(Handle, hRgn, False);
end;

end.
Hi Darkheart,

I'm the developer of BalloonDialog. I see that you can implement BalloonDialog in Delphi.

Can you tell me how you can do it, or send me a litle  example to upload in my site for the Delphi users.
I will send you a free registration for the new version.

Thanks,

Esteban Hugo Somma
SommyTech