[fpc-pascal] Implementing an COM-style Interface: Function Redirection Problems

Leandro Conde lconde at str.com.ar
Fri Mar 24 19:14:23 CET 2006


Hi people,
 
I've been trying to port, from Delphi to FPC in windows, a large open source
library which uses many COM-style interfaces, and in this process found that
the "interface function redirection" [1: see below] feature, for redirecting
the interface's methods to other functions with different names, is not
working properly ... 

I'm using the version 2.0.2:

   Free Pascal Compiler version 2.0.2 [2005/11/26] for i386
   Copyright (c) 1993-2005 by Florian Klaempfl

 
Where I can find more information about this? Is this a problem with the
compiler? I haven't found it reported in the bugs section, nor can I found a
mention of it in the Wiki (search). 

 
Thank you for any help.
Leandro.


[1] I talking about this:
 
Ix = interface
  //... GUID
  function A1(a: sometype): SomeReturn; 
  function A2(b: othertype): SomeOtherReturn; 
end;
 
And then, implementing it:

Tx = class(TInterfacedObject, Ix)
protected // Ix impl ..
  function Ix.A1 = MyA1; 
  function Ix.A2 = MyA2; 
protected
  function MyA1(a: sometype): SomeReturn; 
  function MyA2(b: othertype): SomeOtherReturn; 
end;

With that, the compiler complains about not finding the implementation for
functions A1 & A2 for interface Ix.

This is the error text: 

    "Error: No matching implementation for interface method"


It is a known bug? If it is not reported I can prepare a sample program for
reproducing this issue.


Cheers,
Leandro.




More information about the fpc-pascal mailing list