From: Vlad K. <hv...@us...> - 2011-03-30 17:40:49
|
> On 30-03-2011 08:04, Vlad Khorsun wrote: >> >> With Delphi you will just use IAttachment, without SmartPtr, as Delphi's "interface" have >> built-in compiler magic to work with reference counts. >> > AFAIK, this is not how it works. > > Delphi "interface" has nothing directly related with refcount. > > Refcount comes on when IInterface is used, but IInterface is about COM > (has queryInterface). I don't think you can make our interfaces to work > with IInterface, so you won't get RAII with Delphi and our interfaces. Therefore it will be very desirable to add queryInterface to the our base interface, even empty or raising notImplemented error. IUnknown *is* industry standard, despite of our wish to accept it. Simple Delphi wrappers could be written to deal with reference counters but i prefer to add queryInterface to the our interfaces. Regards, Vlad |