For example if there are two Interface : IinterfaceA,IinterfaceB
can I implement these two interface in one class?
Thanks
pingyu
___
fpc-pascal maillist -
On 14.11.2010 13:08, yu ping wrote:
For example if there are two Interface : IinterfaceA,IinterfaceB
can I implement these two interface in one class?
Yes, you can. Take the following example:
type
IInterfaceA = interface
procedure A;
end;
IInterfaceB = interface
procedure
On 14 November 2010 14:08, yu ping wrote:
For example if there are two Interface : IinterfaceA,IinterfaceB
can I implement these two interface in one class?
Yes you can, but be warned, Interfaces doesn't seem to be a high
priority feature in FPC - I don't think many here use Interfaces.
There
Hi Everybody,
On 14 November 2010 16:31, Jonas Maebe wrote:
Please don't spread FUD. There are several projects that make heavy use of
interfaces that work fine with FPC (e.g. Zeoslib). Yes, interface delegation
is not finished (other than that, interfaces work fine afaik)
Let me just
On 14.11.2010 17:49, Graeme Geldenhuys wrote:
* incomplete delegation (non existent in FPC 2.4.2)
I haven't used this for quite a long time, so I can't test it just
now... what are you missing?
* No name resolution (function aliases) of conflicting interfaces
Ehhh... the
Sven Barth schrieb:
* No name resolution (function aliases) of conflicting interfaces
Ehhh... the following code compiles with 2.4.2 and even 2.4.0:
Typical FUD tactics: mix something people know being true with something
wrong and they believe you the wrong statement.
var
t:
On 14.11.2010 18:17, Florian Klaempfl wrote:
var
t: TMyInterfacedObject;
i: IMyInterface;
begin
t := TMyInterfacedObject.Create;
try
i := t;
t.Foo;
i.Foo;
finally
t.Free;
end;
end.
source end
Output is:
output begin
Foo
Bar
An unhandled exception occurred at $08056B71 :
On 14 November 2010 19:11, Sven Barth pascaldra...@googlemail.com wrote:
* No name resolution (function aliases) of conflicting interfaces
Ehhh... the following code compiles with 2.4.2 and even 2.4.0:
My apologies then, I must not have seen the announcement. I also
looked in my ref.pdf
I suspect the reason is that the object still has a refCount of 1 when you free
it and this code raises the exception:
procedure TInterfacedObject.BeforeDestruction;
begin
if frefcount0 then
HandleError(204);
end;
You should never free an interfaced object
FWIW, both interface delegation (implements) and method aliasing have been
supported in FPC for at least 2 years (we first tested/used them in January
2009 with FPC 2.2.2 which was released in August 2008).
* We have used method aliasing extensively - it appears to behave the same as
10 matches
Mail list logo