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. COM
  3. polymorphism

polymorphism

Scheduled Pinned Locked Moved COM
3 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.
  • R Offline
    R Offline
    Rao
    wrote on last edited by
    #1

    why cant we have two methods with same name but different arguments in an interface ? I tried it in VB and VC it is giving problems

    A B 2 Replies Last reply
    0
    • R Rao

      why cant we have two methods with same name but different arguments in an interface ? I tried it in VB and VC it is giving problems

      A Offline
      A Offline
      Alex Gorev
      wrote on last edited by
      #2

      Hi, If you want to use your object with late binding, there is no way the GetIDsOfNames method of the IDispatch will know which ID to return, if it has two methods with the same names. So the problem is that the clients like VB or ASP do not know what to do with that kind of the objects. As I heard this problem will be fixed in the new version of VB and C#. Regards, Alex Gorev, Dundas Software.

      1 Reply Last reply
      0
      • R Rao

        why cant we have two methods with same name but different arguments in an interface ? I tried it in VB and VC it is giving problems

        B Offline
        B Offline
        Brian Hart
        wrote on last edited by
        #3

        What you're talking about is called "overloading functions." Polymorphism is a different thing entirely! Plus, you *can* have such methods if they are in an IUnknown-based (custom) interface, but you have to promise never to use it with VB... :) Brian Hart

        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