ActiveX Applets

Programming Stress Analysis Dynamic Analysis    
C# C / C++ Fortran Java Unix / Perl
 MFC ActiveX  DLL  Utilities  
  Back     Info
 
What are ActiveX controls?

ActiveX controls are nothing more than Windows program modules contained in dynamic link libraries (DLL's).  What makes an ActiveX control different from a plain old DLL is that the functions and data in an ActiveX control DLL conform to a standardized object-oriented paradigm invented by Microsoft.  This means that certain programs that are "ActiveX aware" can directly import (or embed) the ActiveX control.  Such programs are commonly referred to as ActiveX containers.  ActiveX container programs are abundant, if not ubiquitous,  and include the Microsoft Office programs such as Word and Excel and, of course, Internet Explorer. 

Stated another way, an ActiveX control is simply a computer program that is designed to run inside of another computer program.  ActiveX controls are just like any other Windows program.  They are not limited in any way, and can do anything that any other Windows program can do.  All they need are container programs to run in.  ActiveX controls or applets generally have considerable power and performance advantages over Java applets.  And, of course, unlike a Java applet, an ActiveX control can be readily used by other ActiveX container programs, such as Excel, Matlab, or Mathcad.  However, along with this ActiveX power, comes potentially a greater risk.  Just like in life, more power requires more knowldege and more responsibility. 

This means that a user must exercise some caution when choosing to run an ActiveX control on his/her system—the same caution that is required when installing any software.  The reason for caution is that, unfortunately, not all software works properly.  In fact, bad software can adversely affect your system performance, and can be hard to get rid of.  And, even more unfortunately, there does exist a profusion of malevolent software that is actually designed to damage your system or steal data from your system.  Such software, commonly referred to as viruses, could be contained in an ActiveX control.  This is why Internet Explorer warns the user about installing an ActiveX control.  You must trust the source of the ActiveX control, just like you must trust the source for any software that you put onto your computer. 

Java applets, on the other hand, provide a layer of separation between the applet and the local file system.  The Java Virtual Machine, or JVM, is the extra layer of software that must be installed for the Java applet to run.  Java applets cannot access the full power of the computer system which greatly reduces the risk from malevolent software. 

What happens when I "install" an ActiveX control?

Here is what happens when you choose to allow Internet Explorer to install an ActiveX control on your system.  First, the control is copied from the internet and put into a special directory on your computer file system.  The location of this directory depends on your version of Internet Explorer, and probably also on your version of Windows.  ActiveX controls are really DLL's that typically have a file extension of *.ocx.  So you can easily search your system to find where the ocx files are located. 

Once the ocx file has been copied to your computer, it is useless and inoperable until it gets "registered".  "Registering" the control simply means putting several entries into your system registry to tell ActiveX container programs about the identity, type, and location of the ActiveX control so that they can run (or embed) the control.  This registration process happens automatically when you "install" an ActiveX control while browsing with Internet Explorer.

If you ever want to disable or "uninstall" the ActiveX control then you just do the above procedure in reverse:  First you unregister the control then you delete the file.  How do you unregister the control?  One way is to simply use the regsvr32.exe program that is provided by your Windows OS.  This program is run at the command line by typing "regsvr32 /u FullPath.ocx".  The /u option uninstalls the ActiveX control.  Of course, first you must find the location (full path) of the ocx file. 

Where can I find out more about ActiveX?

Just do a Google or Yahoo search and you will find more ActiveX info that you can read in a lifetime.  I use an excellent tool to manage (register and unregister) my ActiveX controls.  This tool is called ActiveX Manager, and it is available at www.4developers.com