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 - Class

Interface - Class

Scheduled Pinned Locked Moved COM
comtutorialquestion
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.
  • K Offline
    K Offline
    Karri Mohan
    wrote on last edited by
    #1

    How to convert interface object to its class? I have an interface object say IMarkSet. I passed to an COM function. There i need to access a function which takes CMarkedSet . Thanks

    Mohan

    R P 2 Replies Last reply
    0
    • K Karri Mohan

      How to convert interface object to its class? I have an interface object say IMarkSet. I passed to an COM function. There i need to access a function which takes CMarkedSet . Thanks

      Mohan

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      AnanyaMohan wrote:

      I have an interface object say IMarkSet. I passed to an COM function. There i need to access a function which takes CMarkedSet . ^ | v How to convert interface object to its class?

      The answer is really simple: you don't. The reason may be a bit more complicated.... This is a design flaw either in your class or the interfaces it exposes and perhaps even a combination. This is all about abstraction and encapsulation. A COM object/server exposes several interfaces that can be used to alter the behaviour and/or state of the server. Whatever the server is supposed to do, it must be possible to trigger it through the interfaces. Perhaps you need to query for another interface, or even implement an additional interface, but that's all right; it's supposed to work that way. But how the server accomplishes its task is entirely up to the server and is encapsulated behind interfaces. In short: you have to re-evaluate your design.

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      1 Reply Last reply
      0
      • K Karri Mohan

        How to convert interface object to its class? I have an interface object say IMarkSet. I passed to an COM function. There i need to access a function which takes CMarkedSet . Thanks

        Mohan

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        AnanyaMohan wrote:

        There i need to access a function which takes CMarkedSet

        That simply is wrong thing, you are trying to do. Always talk through interface.

        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