Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Interface Inheritance

Interface Inheritance

Scheduled Pinned Locked Moved COM
c++questioncomoop
4 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Rogan
    wrote on last edited by
    #1

    Hello, I am new to COM/ATL programming and have a question. If I want to inherit one interface from another I have previously written (e.g. IB : IA ) do I need to implement all of IA's methods in IB? if so is there any way I can use some technique that allows you to just directly call the IA method instead of having to re-write (as in C++). Thanks. Paul.

    P 1 Reply Last reply
    0
    • P Paul Rogan

      Hello, I am new to COM/ATL programming and have a question. If I want to inherit one interface from another I have previously written (e.g. IB : IA ) do I need to implement all of IA's methods in IB? if so is there any way I can use some technique that allows you to just directly call the IA method instead of having to re-write (as in C++). Thanks. Paul.

      P Offline
      P Offline
      Pete Bassett
      wrote on last edited by
      #2

      Check out Agregation

      P 1 Reply Last reply
      0
      • P Pete Bassett

        Check out Agregation

        P Offline
        P Offline
        Paul Rogan
        wrote on last edited by
        #3

        I have had a look at aggregation - could I override methods from my base interface using this? e.g. where IB : IA IA* pIA = null pIB->QueryInterface(IID_IA, &pIA) 1) pIA->methodA() 2) pIB->methodA() would 1) call the same thing as 2) -- I think it would if these were C++ classes (using cast instead of QI). help! :confused: :confused: :confused:

        R 1 Reply Last reply
        0
        • P Paul Rogan

          I have had a look at aggregation - could I override methods from my base interface using this? e.g. where IB : IA IA* pIA = null pIB->QueryInterface(IID_IA, &pIA) 1) pIA->methodA() 2) pIB->methodA() would 1) call the same thing as 2) -- I think it would if these were C++ classes (using cast instead of QI). help! :confused: :confused: :confused:

          R Offline
          R Offline
          Ryan Park
          wrote on last edited by
          #4

          Sure. 1) and 2) will call same function implementation. I don't quite catch your intention. This is just simple class or struct inhertance. This is nothing to do with COM as I understand. What do you want to do? Regards, Ryan

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups