Neven MacEwan quite correctly points out:

> You can also delegate the inplemenation of an interface in delphi
<snippage>
> ie
>
> TClassC - class(TClassA, InterfaceB)
> private
>   FClassB: TClassB
> property
>   InstClassB read FClassB write FClassB implements InterfaceB
> end

But if you are doing any COM work you must be extremely careful using this
sort of mechanism. There is a assumption in COM that objects being the same
can be checked by comparing the IUnknowns of two interfaces to see if they
are the same. So in the above example casting to InterfaceB and then to
IUnknown must produce the same result as just casting to IUnknown. See
http://www.techvanguards.com/com/tutorials/tips.asp point 12 for a more
detailed explanation.

Cheers, Max.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to