Why COM
-
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
-
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
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.
-
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