Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Using Microsoft Agents with Delphi 6.0

Posted on 2003-03-06
12
Medium Priority
?
683 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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 35

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 35

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 35

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

564 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