Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My company makes electronic products (pcb boards) and I work with software in C++ that talks to the electronics on the baords. Additionally we also have a suite of applications that use Component object model for everything. The GUI's are using MFC and COM is used to talk across Dlls for everything. My question is COM seems like very old technology and they are stuck there because everything uses COM for the last 30 years. Is this a good place to work in and learn? They probably will not change in a while. Do a lot of companies use COM and ActiveX like this or is this because they did not upgrade their control and stuck with the old technology? They only recently started using C++ 11. If they wanted to make a change what could they do?

What I have tried:

I have looked into other technologies. I am not sure what can replace all the elements of COM. They would have to do a lot of work to start over definitely.
Posted
Updated 23-Nov-19 20:20pm

While it is old it is still very common to find it within manufacturing environments.

Where I work we use it as an interface between automated testing machines and various services and databases.

A couple hours away another manufacturer just had to resurrect their old COM and COM+ projects as the handheld devices they use are now Android based instead of Win CE so they lost NET Framework and did not have a time for re-write

So, while it is not state-of-the-art, it is one of those things that just works; and I think it will be around for a long time.
 
Share this answer
 
As far as I known, no, they do not. COM and ActiveX seem to be rarely used these days. MFC is also rarely used.

It is possible to use DLLs with MFC and without COM or ActiveX. I have done that a lot.
 
Share this answer
 
Comments
F-ES Sitecore 22-Nov-19 5:15am    
> COM and ActiveX seem to be rarely used these days.

Office uses COM, Visual Studio uses COM, most non-dotnet apps you have installed on your machine probably use COM, and even some of the .net ones will use it too, plug-ins from apps to browsers use COM.
Stefan_Lang 25-Nov-19 4:11am    
Office uses OLE 2, not COM. I admit I only now found out that OLE 2 itself uses COM. But to say that Office uses COM is still misleading.

Also ActiveX, for all an internet search could turn up, is not built on COM. It only adapts it's API. Plugins in Internet Explorer use ActiveX, not COM. Plugins in other browser use other APIs, e. g. CORBA or XPCOM, or something newer.

VisualStudio - I haven't found any reference about VisualStudio using COM, OLE (2) or ActiveX. It probably uses at least one of them as an API for plugins, but since MS kicked them out in Edge, I wonder if they didn't do the same for VS? I don't know. Do you have a reference regarding VS 19?

As for other apps, why should most of them use an old, badly documented close-sourced API when they could instead use open-source alternatives? Or if they need COM compatibility, why not use the newer APIs of OLE 2 or XPCOM?

I don't think your statements are accurate. If you think otherwise, please provide references.
F-ES Sitecore 25-Nov-19 4:51am    
> Office uses OLE 2, not COM

Set oWord = CreateObject("Word.Application") // Word.Application is a COM object
oWord.Visible = True
Set oDoc = oWord.Documents.Add

Set oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "Ok, boomer"
oPara1.Range.InsertParagraphAfter

> If you think otherwise, please provide references.

No need. It does. The code above is using COM. You're talking about document formats, I am talking and code manipulation.
Stefan_Lang 25-Nov-19 7:26am    
The OP and me were talking about C++. Here is an article describing how to automate word documents in C++:
https://www.codeproject.com/Articles/1145676/Automating-Word-using-Visual-Cplusplus-MFC-in-Visu

While the article doesn't state it (not that I've seen); it appears to be using OLE (class COLEVariant might give you a hint).

Yes, some of the function calls are *implementations* of the COM API, but it is OLE nonetheless.
F-ES Sitecore 25-Nov-19 7:36am    
"Here is an article that doesn't actually say I am right but it says I am right".

Ok.
The usage of these old technology is vanishing. For a young programmer is it a more risky way. I worked some years with that complicated stuff and now in mobile programming and so can tell from my experience that it is weired stuff which is tightly connected to windows and Microsoft tools. And MS sometimes stops the development of some tools.

I would rate that this topics are more for an seasoned programmer (50+) at the end of his career, who wants to profit from his experiences in the last 20 years. Like me ;-)
 
Share this answer
 
Update 2: After some disagreements (see comments) I've finally found a good site to read up on COM: The Component Object Model - Win32 apps | Microsoft Docs[^].

While this doesn't directly disagree with anything I've said, it seems that, under the hood, COM is still very much alive in Windows. You should be aware however, that most applications use COM only indirectly, through DLLs and frameworks like OLE (2).

To find alternatives, an internet search for browser plugin technology should turn up some results. I think plugins are the most common application of COM-like functionality nowadays.



Quote:
Is this old technology?

No, it's ancient. The oldest tech of that type I've used myself was OLE 2, back in the 90s. Even then COM was outdated!
Quote:
Is this a good place to work in and learn?

Sure, if you're interested in archeology ...

On a more serious note, no, definitely not. If you happen to have grown up with these techs, it's ok to stay. But learning them just to be able to do that job? Never!
Quote:
They probably will not change in a while.

If they don't change, they'll soon die of old age with the last programmers that even know about COM.
Quote:
If they wanted to make a change what could they do?

1. Spend some effort and find good programmers who are fluent in current software technologies for C++ and related languages, and are willing to work on refactoring dinosaurs into cheetahs.

2. Don't aim for C++11, aim for C++17 and constantly moving up to the newest standard. Aiming for an already outdated standard is what your company did 30 years ago - don't repeat that mistake!

3. It might help to first spend some time to investigate which modern frameworks exist that could help replace the old functionality. I'm no expert in that area, but I have a feeling that web technology might provide anything that you need. Turning your programs into apps that run on web servers and are used via thin clients could transform your whole business. Of course that means you'd need web developers, probably more than one. Well, nobody said this would come cheap ;-)

4. Once you've decided where to go, you need to decide how to get there.

If it's important to keep current users happy, you may need to go slow, and you may need to support both the new and old technologies concurrently. Since you say you have many programs, it's probably best to refactor them one or two at a time.

The alternative would be to create a GUI and communication framework for all of your programs, pack the old core functionality into a DLL, and call these functions from newly developed programs based on this framework. That development would have to take place while maintainig the existing set of programs. If you don't have the capacity for that, you need to hire more people. Of course you could also try using consultants, but IMHO that wouldn't be a good idea: you need the new knowledge to stay in the company.

Quote:
Do a lot of companies use COM and ActiveX

I'm surprised to hear that there are still companies using COM - I would have expected them to move on or die at least 10 years ago. As for MFC, it still sticks around, mainly because it was still omnipresent in all Windows versions up to and including Windows 8.1. ActiveX is in-between. While newer than MFC, it was considered a security risk a long time ago, and shunned by most companies since at least 10-15 years. Besides, it was mostly used in gaming, and the gaming industry is fast to move on to new technologies.
 
Share this answer
 
v4
Comments
F-ES Sitecore 22-Nov-19 5:17am    
COM didn't exist when OLE was being developed, COM grew from that concept.

> I'm surprised to hear that there are still companies using COM

All Microsoft products you have installed on your machine right now use COM.

If you suggest the OP doesn't use COM then what do you suggest he uses for inter-DLL communication instead? What inter-DLL tech has replaced COM, a technology you are surprised to hear is still in use?
MadMyche 22-Nov-19 7:47am    
Exactly. OLE came out in 90, COM in 93, and then ActiveX in 96
Stefan_Lang 25-Nov-19 3:26am    
I was referring to OLE 2, which came after COM, and by some (many?) was considered it's replacement. I couldn't find a statement regarding release date, but it must have been around 1995.

Regarding the age of COM, my memory didn't serve me well. Please see my other comment.
Stefan_Lang 22-Nov-19 8:25am    
'COM didn't exist when OLE was being developed'
Both COM and OLE 2 were based on OLE 1. You are right, my information was a bit misleading in that regard.

I worked on OLE 2 at a time when COM already existed, and as far as I knew, OLE 2 was considered the more modern standard. However, opinions were split on DCOM, which was still under development at that time.

I didn't really follow that development though, since I moved on to client-server applications using database servers and local clients.

'All Microsoft products you have installed on your machine right now use COM'

Do they? I thought MS kicked out all the old stuff with Windows 10. But I have to admit I never really investigated that. Communication protocols are not my field of expertise.

Update: I looked it up and found that, indeed, COM still appears to be alive and well. It is mostly hidden within newer DLLs or under less conspicuous APIs however, which explains why I wasn't aware of that.

'If you suggest the OP doesn't use COM then what do you suggest he uses for inter-DLL communication instead?'

Given this new information on the state of COM, I have to admit I can not answer this question.

Thank you for pointing out my error. I did learn something from that. On top of that I'm not the only one getting older ;-)
Dave Kreskowiak 22-Nov-19 10:41am    
COM is still very much alive, and still used extensively throughout Windows. For backward compatibility reasons, it isn't going away any time soon. It'll probably be at least another 20 years of slow decline before it "dies on the vine".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900