?
Solved

Using Microsoft Agents with Delphi 6.0

Posted on 2003-03-06
12
Medium Priority
?
676 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:Darkheart
[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
  • 4
  • 3
  • 2
  • +3
12 Comments
 
LVL 2

Expert Comment

by:Zip58
ID: 8082539
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
0
 

Author Comment

by:Darkheart
ID: 8082574
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
0
 
LVL 2

Expert Comment

by:Zip58
ID: 8082606
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
0
Technology Partners: 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 5

Expert Comment

by:Lukasz Lach
ID: 8082617
0
 

Author Comment

by:Darkheart
ID: 8083123
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
0
 
LVL 34

Accepted Solution

by:
Slick812 earned 150 total points
ID: 8086366
hello Darkheart, when using the Agents, I have used a pop up Information Panel (the Panel was hidden, and since I knew where the agent was going to be, I just showed the Panel, it had some Radio buttons on it), ,  You control and move the Agents, so you know their screen locations, you can just pop up a Form near the agent, with Info or something to get input (a TEdit, a TMemo, check boxes, ect.), and have the agent point at the Form and tell you to type your name in the Edit. . . . If you just have to have a "Baloon" Text container. . .  you can use a region to shape your pop up form. . Do you need code for this?
0
 
LVL 34

Expert Comment

by:Slick812
ID: 8086414
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
0
 

Author Comment

by:Darkheart
ID: 8090458
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
0
 

Author Comment

by:Darkheart
ID: 8091340
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 !
0
 
LVL 34

Expert Comment

by:Slick812
ID: 8092679
you might look at this page at EE for some code I have done for a sample MS Agent program

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20426843.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.
0
 

Expert Comment

by:ehsomma
ID: 8413542
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
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 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