RAD Studio
ContentsIndex
PreviousUpNext
Code Generated by Wizards

Delphi's wizards generate classes that are derived from the Delphi ActiveX framework (DAX). Despite its name, the Delphi ActiveX framework supports all types of COM objects, not just ActiveX controls. The classes in this framework provide the underlying implementation of the standard COM interfaces for the objects you create using a wizard. The following figure illustrates the objects in the Delphi ActiveX framework: 

Delphi ActiveX framework 

Each wizard generates an implementation unit that implements your COM server object. The COM server object (the implementation object) descends from one of the classes in DAX:  

DAX Base classes for generated implementation classes  

Wizard 
Base class from DAX 
Inherited support 
TTypedComObject  
Support for IUnknown and ISupportErrorInfo interfaces.
Support for aggregation, OLE exception handling, and safecall calling convention on dual interfaces.
Support for reading type library information.  
TAutoObject  
Everything provided by TTypedComObject, plus:
Support for the IDispatch interface.
Auto-marshaling support.  

Corresponding to the classes in DAX is a hierarchy of class factory objects that handle the creation of these COM objects. The wizard adds code to the initialization section of your implementation unit that instantiates the appropriate class factory for your implementation class. 

The wizards also generate a type library and its associated unit, which has a name of the form Project1_TLB. The Project1_TLB unit includes the definitions your application needs to use the type definitions and interfaces defined in the type library. For more information on the contents of this file, see Code generated when you import type library information

You can modify the interface generated by the wizard using the type library editor. When you do this, the implementation class is automatically updated to reflect those changes. You need only fill in the bodies of the generated methods to complete the implementation.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!