ActiveX custom controls, or OCXs, are the 32-bit descendants of the dynamic link library (DLL) and, more recently, the Visual Basic Control (VBX).
DLLs are programs that provide functions and procedures to other programs. The VBX control is also a DLL, but with special features that enable people to use the control seamlessly in the Visual Basic development environment. The VBX files are used with 16-bit operation systems such as Windows 3.x.
The Win32 API brought another form of custom control: the OLE custom control (or OCX). Now they are called ActiveX controls. An ActiveX control is different from a VBX or DLL because the control is registered with the operating system when it is installed. After an ActiveX control is registered, it can be used as a component by any application developed, using any one of many different development environments (subject to certain licensing restrictions), including VBScript.
An ActiveX control is more advanced and flexible in that it implements OLE in process servers as DLLs. In other words, it supports some very useful OLE features, such as in-place activation, automation, and event notification. Table 1 lists the library types used in Windows.
Table 1. DLLs and custom controls.
| Control | Extension |
Function |
| Dynamic link library | .DLL |
Enables users to access functions, routines, and resources from other applications. |
| Visual Basic | .VBX |
Provides the same custom control capabilities as a DLL. Can be used graphically in a development environment, such as Visual Basic 3.0, and Delphi 1.0. |
| ActiveX control | .OCX |
Provides the same services as a DLL or VBX. In addition, the OCX can take advantage of extremely powerful OLE features. |
Like other OLE objects, when you install an OCX file, it is registered with the operating system in a system database called the Registry. When an OCX file is registered, its unique class ID (CLSID) number is placed in the system Registry. The CLSID number called from your HTML Web page instantiates (or creates an instance of) the object on the page on the client machine.
OLE significantly adds to the flexibility and capabilities of a Web page in a client/server environment like the Internet. An OLE object or an OCX can do anything that can be done on the client machine. The possibilities are exciting, but there are risks (which will be discussed in the next lessons).
Go To Page: 1 2