Reputation: 2921
I want to know when and why to use COM?
Please let me know in which situation I need to use com instead of normal DLL.
Upvotes: 0
Views: 147
Reputation: 8145
You use COM in various contexts, such as:
interacting with the msxml3/4/6 XML API (consuming COM objects);
embedding an Internet Explorer WebBrowser control (consuming COM objects);
implementing Explorer Shell extensions such as context menus (writing and consuming COM objects);
implementing drag and drop functionality (writing and consuming);
using the Vista-based file open/close dialogs (consuming);
using the Windows-based ribbon API (consuming).
Upvotes: 1
Reputation: 22010
First, it's worth mentioning that COM is quite an old technology. It significantly predates .NET, which sometimes provide the same functionality. However, comparing to a plain DLL, it has a few advantages, for example:
This is just the tip of the iceberg. Although dated, COM is widely used in Windows. Whether it's the right technology for you to use these days is a different matter - this really depends on your specific needs. But if you're a Windows programmer, it's definitively worth getting familiar with anyway. Even it you don't produce any COM product, you're very likely to consume one.
Upvotes: 6