Board index » delphi » Callback function in Interface method

Callback function in Interface method


2007-05-11 01:41:35 AM
delphi46
Hi all,
I need a help with next code. I have this interface:
IExporter = interface(IDispatch)
['{DB9774A0-C557-4567-B097-7D3B8EC4270D}']
procedure Connect(const bstrDataSource: WideString; const pCallback: IDispatch); safecall;
.
.
.
.
end;
Here, pCallback must be a function like this:
function OnConnect(a: Integer; b: String);
How can I do to assign a function like that to the pCallback parameter?
Thanks.
Germán
 
 

Re:Callback function in Interface method

On 10 mayo, 14:41, "ghoffman" <XXXX@XXXXX.COM>writes:
Quote
Hi all,

I need a help with next code. I have this interface:

IExporter = interface(IDispatch)
['{DB9774A0-C557-4567-B097-7D3B8EC4270D}']
procedure Connect(const bstrDataSource: WideString; const pCallback: IDispatch); safecall;
.
.
.
.
end;

Here, pCallback must be a function like this:

function OnConnect(a: Integer; b: String);

How can I do to assign a function like that to the pCallback parameter?

Thanks.
Germán
Please I need some help with this. I must to pass a procedure like
"procedure (const iRes: Integer; const str: WideSTring)" to the
pCallback param in connect method. How can I do this?
ghoffman