Using Microsoft Agents with Delphi 6.0
Posted on 2003-03-06
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
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).