1

I have unfortunately inherited a legacy project which makes heavy use of ActiveX controls. As a new software engineer, I haven't ever had the need to use ActiveX before and, from what I understand, it is deprecated anyway. From what I understand, it's a web technology, but it's used for compatibility with various Microsoft products.

The software is being used to control a piece of heavy machinery, so I'm really not understanding the connection with a web technology. Ultimately, the customer will be getting a DLL from us, which they'll use to program the machine with. This DLL has low-level drivers that control the various parts of the machine, whether that be over PCI or RS232. But, it also updates these ActiveX controls as it interacts with the machine.

I'd appreciate if somebody more experienced with ActiveX technology could give me some insight as to why it might have been used in this application. The ONLY reason I could think of is that, since the product will be used in a factory environment, perhaps remote control might have been important. Most of our products make use of SECS/GEM technology.

Adding the controls to an Excel spreadsheet only results in a white ellipse on the page. This is true of all the ActiveX controls in this project.

Community
  • 1
  • 1
audiFanatic
  • 2,296
  • 8
  • 40
  • 56
  • It does not have anything to do with "web technology", it is a general technology to make components available to a client program written in a different language. There is a learning curve involved, understanding COM is a very basic requirement and learning ATL would probably be wise. Just don't assume that a week is going to be enough to master it, ask your supervisor for time and access to learning resources. – Hans Passant Jan 29 '16 at 16:26
  • Ahh, that makes much more sense. So I guess the purpose is to allow the customer to write their program in a language other than C++? – audiFanatic Jan 29 '16 at 16:29
  • Yes, the COM interface was designed so that clients could be written in any language, as long as they could (a) query the COM registry/ODL for the interface, and (b) marshal data per the COM specification. With a regular "C" DLL, you need to get each function's signature and calling convention, usually with a header file, and then match the binary interface. COM tried to make this easier. Obviously, it's an older technology and other things have come along in the last 20 years. – Dan Korn Jan 29 '16 at 16:35
  • @DanKorn So where do ActiveX controls come into the picture? – audiFanatic Jan 29 '16 at 16:42
  • ActiveX was designed as a way for OLE embeddable GUI controls to be built with COM interfaces. But it can also be used as a container for a "headless" control that doesn't actually act as a user interface item, to expose an API via COM. The best examples of this are probably ASP and ADO (ActiveX Data Objects), although there are lots of third-party objects as well. – Dan Korn Jan 29 '16 at 20:20
  • Ah, that makes perfect sense. @DanKorn, please promote your comment to an answer so I can give you some credit where credit is due – audiFanatic Jan 31 '16 at 04:00
  • Answer added, thanks. – Dan Korn Feb 01 '16 at 18:25

1 Answers1

1

COM was designed so that clients could be written in any language, as long as they could (a) query the COM registry/ODL for the interface, and (b) marshal data per the COM specification. With a regular "C" DLL, you need to get each function's signature and calling convention, usually with a header file, and then match the binary interface. COM tried to make this easier.

ActiveX was designed as a way for OLE embeddable GUI controls to be built with COM interfaces. But it can also be used as a container for a "headless" control that doesn't actually act as a user interface item, to expose an API via COM. The best examples of this are probably ASP and ADO (ActiveX Data Objects), although there are lots of third-party objects as well.

Obviously, COM and ActiveX are older technologies, and other things have come along in the last 20 years.

Dan Korn
  • 1,274
  • 9
  • 14