CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 1999
    Location
    FRANCE
    Posts
    28

    COM and derived interface

    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

    Yoann

  2. #2
    Join Date
    Oct 2001
    Location
    Phoenix, AZ
    Posts
    54

    Re: COM and derived interface

    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

  3. #3
    Join Date
    Jul 1999
    Location
    FRANCE
    Posts
    28

    Re: COM and derived interface

    Yes, IInt1 and IInt2 are described into a dll that is included as a reference for the project.

    Yoann

  4. #4
    Join Date
    Oct 2001
    Location
    Phoenix, AZ
    Posts
    54

    Re: COM and derived interface

    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

    [vccode]
    interface IInt2 : IInt1 : IDispatch {}
    [/vccode]

    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

  5. #5
    Join Date
    Jul 1999
    Location
    FRANCE
    Posts
    28

    Re: COM and derived interface

    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

    Yoann

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured