There are several ways to create ActiveX controls using 3GLs, including:
- Using the Microsoft Foundation Classes (MFC)
- Using the ActiveX Template Library (ATL)
- The BaseCtrl Framework
Most current ActiveX development uses MFC because MFC has been around the longest and many C++ developers know it. Also, unlike the other techniques, MFC enables developers to concentrate on the behavior of the object rather than the interface. The downside (especially for Internet distribution) is the size of the controls and the need for a run-time DLL to exist with the container.
ATL is able to generate code each time you need it using templates. Thus, you don't need libraries or DLLs that have to ship along with the control. ATL requires that you derive a class from several base classes existing as templates. Typically, developers will use the ATL wizard to create the classes automatically. ATL also has drawbacks. It's much more difficult to deal wit
h interfaces using ATL since you must create each interface you need for your application. Also, ATL does not support the Class Wizard that's able to automatically keep the Object Description Language and interface definition language files in synch with your code. The wizards leave a lot to be desired.
BaseCtrl is a lightweight library, very much like ATL, but without the templates. BaseCtrl is so lightweight, in fact, that Microsoft does not support it. Several skeleton controls come with BaseCtrl. While BaseCtrl provides an easy-to-understand ActiveX control development model, it's not that much easier than ATL, and it does not provide as much flexibility. For now, it's a poor choice for ActiveX control developers.
Tools
Microsoft's Visual C++ was the first tool to provide capabilities for creating ActiveX controls. Today it provides the most control for ActiveX developers. Visual J++ can also create ActiveX controls. This keeps many Java purists up at night, and it's a good comeback
for Microsoft when arguing the ActiveX-versus-Java issue.
Although two of Borland's development tools -- JBuilder and IntraBuilder -- get much attention, Delphi 3.0 and C++ Builder are the only Borland tools able to create ActiveX components. Borland calls Delphi's ActiveX development features Active Inside. The idea is to turn any Delphi Window into an ActiveX form. Active Inside prepares your new control for deployment on the Web. Delphi is also able to link your control to COM or DCOM for links to other objects.
PowerBuilder 5.0 is a client/server development tool redone for use as an ActiveX factory. PowerBuilder is able to deploy Data Windows (the core of PowerBuilder application development) as ActiveX controls, and it allows current PowerBuilder developers to use familiar features such as the PowerScript programming language.
Microsoft has probably the best tools for creating ActiveX controls. Visual Basic 5.0, for example, allows developers to use the friendly visual programming environm
ent of VB and the native Visual Basic for Applications language to create controls.
illustration_link (15 Kbytes)

Part of ActiveX's flexibility is the number of ways you can develop with it.