Click to See Complete Forum and Search --> : COM and derived interface


Yoy
October 22nd, 2001, 04:40 AM
Hi,

I'm trying to create an interface IPerso that is derived from an Interface IInt2. The problem is that IInt 2 is derived from IInt 1 and so VB 6.0 do not compile my dll because IInt 2 does not derived from IDispatch or IUnknown. How can I go through this problem?

Thanks for your help

JHamilton
October 22nd, 2001, 05:17 AM
Interesting problem. Do you have a reference to IInt1 in your project?

Software is like sex, it's better when it's free - Linus Torvalds
Software is like sex, it's better when I get paid for it. - me

Yoy
October 22nd, 2001, 05:32 AM
Yes, IInt1 and IInt2 are described into a dll that is included as a reference for the project.

JHamilton
October 22nd, 2001, 05:52 AM
There is a way to do it, I believe. It just isn't easy. There is a technique called vtbl swapping that might help. I'd have to dig up the book I read it in. I think Matt Curland's book Advanced VB 6 http://www.powervb.com explains this technique.

It's too bad COM interfaces can't inherit from multiple interfaces, ala


interface IInt2 : IInt1 : IDispatch {}


Software is like sex, it's better when it's free - Linus Torvalds
Software is like sex, it's better when I get paid for it. - me

Yoy
October 22nd, 2001, 07:01 AM
Thank you,

I get the same conclusion, it is not possible to do it this with vb6.0. I have read that wit visual basic .net, this case is possible, I'm going to try it...

Thanks for all

Yoann