ActiveX is a very loose definition, applied by Microsoft to anything OLE or Internet. In theory all COM classes are ActiveX controls. However, when referring to ActiveX Controls most people mean visual UI controls, often called OCXs.
OCX Controls are COM classes which implement several Microsoft-dictated Interfaces which make them compatible with OCX containers such as Visual Basic or Visual C++. These Interfaces allow for interaction between the container and the control and implement the following functionality:
Stock Properties
The control may implement various standard properties which the container will be capable of dealing with, such as background colour.
Persistence
Allows controls to save the state of an instance and recreate it later from the stored data. This data may be saved into a compiled executable which uses the control.
Ambient Properties
A container may make suggestions to the controls about details such as which colours or fonts to use. These are called Ambient Properties. The control is under no obligation to use these ambient properties, but well-behaved controls are expected to.
Event Sourcing
The control may send ActiveX Events to its container. These may be Stock Events which all containers handle.
The OLE Control 96 Specification, referred to as OC96, is a set of specifications and Interfaces which result in controls which are more suited to use over slow Internet links than regular OCX controls.
The major changes are:
• No need for an active Window. The UI can be represented by a metafile when the control is not activated.
• Retains font, brush, pen objects between calls, saving time spent selecting and deselecting these objects
• No unnecessary redrawing.
• More-efficient drawing.
• Activation can be achieved by a single call.
• Undo management
• Formal property persistence text format.Internet Explorer 4 was the first container which could make use of OC96 controls. Therefore many of today's controls support both the new and the old Interfaces.
Copyright © Murray Cumming. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.