Quoting res <[EMAIL PROTECTED]>:

> On 02.03.2008 19:11, Amir Taaki wrote:
>> Seems to work good from my tests, but tell me if there's some   
>> glaring errors.
>
> You need to employ scfFakeInterface<iFoo> in the implementation to be
> able to query an iFoo from an object. (The scfImplementation<> stuff
> does not know iBar inherits from iFoo and thus does not automatically
> expose that interface via QI).

To elaborate a bit, the "correct" way to do it is (most of the time)

struct iBaseInterface : public virtual iBase
{
   SCF_INTERFACE(iBaseInterface,1,0,0);
...
};

struct iDerivedInterface : public iBaseInterface
{
   SCF_INTERFACE(iDerivedInterface,1,0,0);
...
};

class Impl : public scfImplementation2<Impl, iDerivedInterface,  
scfFakeInterface<iBaseInterface> >
{
...
};

-M

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to