3 ms·
There is a subset of COM that is elegant and usable. And there is a ton of stuff that is only rarely used and understood. I'm looking at you, apartment models.
by captainmuon 9y ago
There is a subset of COM that is elegant and usable. And there is a ton of stuff that is only rarely used and understood. I'm looking at you, apartment models.
Basically, COM are conventions how to layout structs and name functions, such that other code can load your DLLs. Coincidentially, they are almost identical to C++ classes, so you can often just return a pointer to a C++ class.
There are layers and layers of conventions stacked, which makes it a bit complicated. On the low level, you can call stuff by knowing the memory layout. You have a header file and a pointer, and call the function at pointer+4. Fine for consuming from C/C++. Later, they developed IDispatch to call a method by string name (good for Visual Basic or scripting). There were interfaces to make Widgets (Custom controls / ActiveX). I personally found that the documentation for all that stuff was not very good.
However, it was fairly easy to create and consume COM components Visual Basic (and to some extend MSVC). There was a booming market for VB custom controls long before .NET. Its a bit unfortunate we don't have something like that today.
- pjmlp 9y ago> Its a bit unfortunate we don't have something like that today. Sure we do. https://www.componentone.com/ https://www.componentone.com/ https://www.devexpress.com/ https://www.devexpress.com/ http://www.telerik.com/ http://www.telerik.com/ And given that UWP and .NET Native are COM reborn, we will keep on having them.