Friday, July 06, 2007

* ActiveX Controls : A Technology Overview

  • ActiveX controls are binary reusable components which can be embedded in web pages or any other application which can act as an ActiveX control container.
  • ActiveX controls are based on COM (Component Object Model) technology standard which defines how interoperable binary reusable components should be developed so that they can interact with each other and any COM based container.
  • There are mainly two frameworks available for developing ActiveX controls:
    • Visual C++ MFC : Visual Studio can be used to build ActiveX controls using MFC. The controls are light weight and get downloaded quickly. Require MFC dll to be available on user's system. In walkthrough we will use MFC.
    • ActiveX Template Library (ATL) : From VC++ team its a collection of C++ templates using which you can create controls very quickly.
  • All ActiveX control classes are sub classed from MFC base class 'COleControl'. This class provides much of the common infrastructure required by any ActiveX control like automation and activation logic.
  • ActiveX control interacts with outside world using set of event-firing functions, properties and methods. These can be used by control containers and users of controls to change the state of control.
  • ActiveX Controls have Active and Inactive states where in active state control is starts responding to external events like mouse clicks and key presses. An ActiveX control can be windowless also.
  • ActiveX control has ability to serialize its state to storage also called persistence and rebuild its state from the storage.
  • ActiveX control has mainly three classes derived from COleControlModule, COleControl and COlePropertyPage classes.
  • COleControlModule provides the control module (.OCX) infrastructure into which more than one ActiveX control can exist.
  • For each ActiveX control in control module there is a class derived from COleControl. This class is where most of the user code resides.
  • As name suggests COlePropertyPage is used to create property pages for control.

1 comment:

  1. We can create activex controls not only from MFC, other options are available like ATL. It is not necessary to derrive your activex control from colecontrol

    ReplyDelete