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. ATL / WTL / STL
  4. Why COM

Why COM

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++comlearning
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.
  • V Offline
    V Offline
    Varghese Paul M
    wrote on last edited by
    #1

    Hi Experts, I am new to COM programming. (Component Object Model.) After learning some theory behind COM, I am wondering Why COM when every thing is possible using DLLs which exports C++ classes. Or What is possible only in COM and not possible in C++ DLLs. Could anyone explain? Thanks in advance

    cheers Varghese Paul

    S L 2 Replies Last reply
    0
    • V Varghese Paul M

      Hi Experts, I am new to COM programming. (Component Object Model.) After learning some theory behind COM, I am wondering Why COM when every thing is possible using DLLs which exports C++ classes. Or What is possible only in COM and not possible in C++ DLLs. Could anyone explain? Thanks in advance

      cheers Varghese Paul

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      COM is intended to be (relatively) language independent (both in terms of class implementers and users). It's designed so that component facilities are discoverable without having to know where or how they're implemented (that's where COM registration comes in). C++ classes exported from DLLs, on the other hand, don't have those properties. The C++ class methods are exported with mangled names that vary depending on the compiler you're using, so can't be predicted without knowing how the DLL was implemented. Also - they're only DLLs. COM classes can be implemented as in-process servers (COM DLLs), out-of-process servers (COM EXEs) or even on a different machine. Another thing - memory management. COM objects are reference-counted and use a language independent memory allocator. C++ classes? Manual memory management through the C++ allocator.

      1 Reply Last reply
      0
      • V Varghese Paul M

        Hi Experts, I am new to COM programming. (Component Object Model.) After learning some theory behind COM, I am wondering Why COM when every thing is possible using DLLs which exports C++ classes. Or What is possible only in COM and not possible in C++ DLLs. Could anyone explain? Thanks in advance

        cheers Varghese Paul

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        Varghese Paul M wrote:

        Why COM when every thing is possible using DLLs which exports C++ classes.

        That statement is incorrect, as Stuart said. You might want to keep reading, have you seen this?[^]

        led mike

        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