New Home
Old Home
Site Map
 
Books
Tips & Tricks
Q & A
Tutorials
Stories
Performance
New in VB6
Free Stuff
Essays
Links
Pictures
 
Awards Received
Banners
 
Newsletter
Feedback
About ActiveX Controls
  • What is ActiveX?
  • How do you Use ActiveX Controls?
  • What Happens When a Web Page Uses an ActiveX Control?
  • What about ActiveX security issues?

    What is ActiveX?

    ActiveX is a specification that indicates how applications should talk to each other. If you build an ActiveX control, you can place it inside another application that understands how to host ActiveX controls. In particular you can place ActiveX controls in:
  • Visual Basic programs
  • Delphi programs
  • Visual C++ programs
  • Programs written in some other languages
  • Web pages
  • Not all hosts support the same ActiveX features. That means an ActiveX control displayed in a Visual Basic application may have different support than one displayed in a Delphi application or on a Web page.

    How do you Use ActiveX Controls?

    How you install and use ActiveX controls in different environments depends on the environment. The book Custom Controls Library tells how to install ActiveX controls in Visual Basic, Visual C++, C++ Builder, VBScript, JavaScript, JScript, J++, Java, Delphi 2 & 3, and HTML. It also shows how to build 101 ActiveX controls using the Visual Basic 5 Control Creation Edition (CCE). The controls and a working copy of the CCE are included on the CD-ROM.

    You can easily include ActiveX controls in Visual Basic programs. To do so, select the control from the Project menu's Components command just as you would any other ActiveX control. You can also include a control's project in a Visual Basic 5 project group. That lets you test the control interactively in the Visual basic debugger.

    The easiest way to use an ActiveX control built with Visual Basic in a Web page is to use the Setup Wizard to create an Internet Download Setup. The setup kit will include an HTM file that contains sample HTML code that displays the control. You can examine this HTM file to see what the code looks like.

    What Happens When a Web Page Uses an ActiveX Control?

    When a Web page that includes an ActiveX control loads, your browser uses the CLASSID information on the Web page's OBJECT statement to decide whether the control is already loaded on your system. If not, the browser uses the CODEBASE information to download the control and install it.

    If you have security set to high, your browser will not download the control. If security is set to medium, the browser will prompt you to ask if you want to download. If security is low (not recommended), the browser automatically downloads the control.

    To run an ActiveX control, your system must have certain Visual Basic support libraries installed. If it does not, the browser will download them, usually from Microsoft's Web site. If you have Visual Basic 5 installed, you should already have these files so the extra download will not be necessary. Once you have downloaded a control like this, you will also have the necessary files so this will not be necessary the next time you use an ActiveX control so the control's download will be much faster.

    What about ActiveX security issues?

    ActiveX controls can do anything a normal Visual Basic program can. For example, a control can erase your hard disk. In contrast, Java applets cannot perform all of the commands a program can so they cannot damage your system.

    To provide some small measure of protection, Microsoft invented a signature scheme. This lets a control designer digitally sign their controls with the help of a signature authority. Later, when you visit a Web page that uses the control, your browser can verify that the control was written by the person who signed it. This does not guarantee that the control is safe, but at least you have some hope that you know who really wrote the control. This is most important when someone copies a control from one Web site to another. The signature lets you know who the original author was.

    The controls on the links below have not been signed. My feeling is if you are getting these directly from my Web page you need to trust me not to provide a bomb anyway.

    If you do not want to download the controls blindly, I don't blame you. Instead you can click on the download links below to obtain sample applications that use the controls. You can them look over the control code, see that it is safe, and modify it for your needs.


  •  
    Subscribe to the VB Helper newsletter
    Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
    www.vb-helper.com/activex.htm Updated