Why should I learn COM?

Recently, I have heard a lot about COM in my work. I also found out that COM is out of date. COM is deprecated. There is no future for COM. Is that also true?

I want to know COM because I want to know what the big problem is, but I cannot convince myself that this is a good reason to spend so much time and study it.

So can anyone tell me:

  • Why should I learn COM?
  • Once I recognize COM, what can I do using it? I mean his applications.
+6
com
source share
4 answers

I just don't see COM go out anytime soon. If you want to become a Windows expert, you need to understand how this works.

+8
source share

Studying COM (or at least in terms of its concepts) means that you can integrate with thousands of existing components, including Microsoft Word and Excel.

I work mainly in the Java domain, but with a little knowledge of COM, I can effectively interact with Word and Excel (in particular) for programmatically creating / reading documents. I do not have deep knowledge, but I have little, and this significantly increases my productivity.

+4
source share

You must learn a lot about COM in order to know that you no longer want to learn.

The details of COM - especially from a multithreaded or C ++ application - are painfully annoying, and I would not want them (I myself do not know them, but I know that I know this).

Therefore, if you need to call the COM library, you should find out enough COM to be able to do this, and then stop. Ideally, use a language such as C # or Delphi, where some (or, hopefully, most) details are processed relatively transparently for you.

There are many COM libraries, but if you feel that you want to use them, you should look at its specific documentation on how to do this - you probably have a reasonable example that you can simply adapt for your own use without much effort. If this is not the case, then this is clearly not very good and should not be used.

+4
source share

COM is definitely worth learning at least at some level if you are a Windows developer. Another common use case, in addition to the ones mentioned above, is the implementation of binary behavior and BHOs for Internet Explorer. They are both implemented using COM interfaces between IE and your code.

I would also recommend several resources for learning COM:

  • Don Box Essential COM . This is a great description of why COM is, and really helps you better understand what is going on. If you take the time to read this book, then you will have a fundamental understanding of the internal components of COM, which will be very good for you.
  • These two articles: { 1 , 2 } ... are a very good discussion of the specific subject of COM apartments, which is referred to as "painfully annoying" (unfairly, imho) in MarkR's answer.
+4
source share

All Articles