Understanding the ActiveX Control

 < Free Open Study > 



As far as COM-based technologies go, the ActiveX control is at the top of the mountain. An ActiveX control is a graphical building block, used in the context of another application. A perfect example of this sort of binary GUI-based reuse is found within the Visual Basic IDE. When you begin building a new VB application, you typically assemble a user interface using items from the VB Toolbox (Figure 14-1). All of these items are ActiveX controls.


Figure 14-1: A palette of ActiveX controls.

Any development environment worth its salt has the ability to include additional ActiveX controls into the IDE, and therefore as part of your current project. Again using VB as an example, if you select the Project | Components menu item, you are presented with the dialog box shown in Figure 14-2, which allows you to select any registered controls into your current project workspace.

click to expand
Figure 14-2: Inserting additional ActiveX controls in VB.

When you select additional controls using the Components dialog, new icons appear in the VB toolbox, and you are then able to work with these graphical COM objects just like the intrinsic VB controls. For example, if we were to place an MS Calendar control onto a VB Form object (Figure 14-3), we would find that all of the available properties appear in the VB Property Window (if the control is selected). Additionally, if we open up the code window and select the Calendar object, we are able to write event handlers for the set of events sent by this control. ActiveX controls integrate so completely into the IDE you are using that you seldom even regard these items as COM objects supporting a set of standard and custom interfaces.

click to expand
Figure 14-3: The MS Calendar Control.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net