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. Inheriting CoClass methods.

Inheriting CoClass methods.

Scheduled Pinned Locked Moved COM
4 Posts 3 Posters 0 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.
  • S Offline
    S Offline
    sandeepkavade
    wrote on last edited by
    #1

    I have one Coclass named CXNode which is implementing methods of interface IXNode. I want IXElement to be derived from IXNode as I want methods of IXNode. In IXElement I have two extra methods GetAttribute and SetAttribute. I don't want to rewrite methods which are already written in CXNode. Thanks in advance!!!

    CPalliniC 1 Reply Last reply
    0
    • S sandeepkavade

      I have one Coclass named CXNode which is implementing methods of interface IXNode. I want IXElement to be derived from IXNode as I want methods of IXNode. In IXElement I have two extra methods GetAttribute and SetAttribute. I don't want to rewrite methods which are already written in CXNode. Thanks in advance!!!

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      sandeepkavade wrote:

      I don't want to rewrite methods which are already written in CXNode

      Hence derive from CXNode. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      A 1 Reply Last reply
      0
      • CPalliniC CPallini

        sandeepkavade wrote:

        I don't want to rewrite methods which are already written in CXNode

        Hence derive from CXNode. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

        A Offline
        A Offline
        aatul
        wrote on last edited by
        #3

        But in COM you can't derive a coclass from another coclass.

        CPalliniC 1 Reply Last reply
        0
        • A aatul

          But in COM you can't derive a coclass from another coclass.

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          You don't need that. You have just to derive the implementation from the C++ class (or make the CoClasses both inherit from the same C++ class, Oh yes, multiple inheritance, ATL docet). :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          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