Vcl.AxCtrls.TActiveXControl

From RAD Studio API Documentation
Jump to: navigation, search

System.Win.ComObj.TAutoObjectSystem.Win.ComObj.TTypedComObjectSystem.Win.ComObj.TComObjectSystem.TObjectTActiveXControl

Delphi

TActiveXControl = class(TAutoObject,
IConnectionPointContainer,
IDataObject,
IObjectSafety,
IOleControl,
IOleInPlaceActiveObject,
IOleInPlaceObject,
IOleObject,
IPerPropertyBrowsing,
IPersistPropertyBag,
IPersistStorage,
IPersistStreamInit,
IQuickActivate,
ISimpleFrameSite,
ISpecifyPropertyPages,
IViewObject,
IViewObject2)

C++

class PASCALIMPLEMENTATION TActiveXControl : public System::Win::Comobj::TAutoObject

Properties

Type Visibility Source Unit Parent
class public
Vcl.AxCtrls.pas
Vcl.AxCtrls.hpp
Vcl.AxCtrls Vcl.AxCtrls

Description

TActiveXControl is an abstract class that provides the functionality to embed a VCL control into an ActiveX Container window.

TActiveXControl defines the core behavior and interfaces required of an ActiveX control and connects that behavior to any VCL control derived from TWinControl. This allows the control to be embedded in any ActiveX container, including Internet Explorer, Visual Basic, PowerBuilder, Paradox, CodeGear C++, IntraBuilder and, of course, Delphi.

To create a new ActiveX control class, use the ActiveX control wizard. The steps for building an ActiveX control are covered in the Developer's Guide or in the online help document, Developing COM-based applications.

The TActiveXControl class is derived from TAutoObject, therefore the object resulting is a COM object that supports COM-based Automation, a type library, and has a factory. In addition, TActiveXControl implements the following behaviors:

  • Embedding in a container (site)
  • In-place activation
  • Persistence
  • Events
  • Property pages
  • Property browsing

TActiveXControl is an abstract class, and so cannot be instantiated. Instead, you must derive a new class from TActiveXControl to implement an ActiveX control. This derived class is called an implementation class. An implementation class derived from TActiveXControl normally implements an automation interface as well, to specify the object's properties and methods.

Ordinarily, you do not create an instance of an implementation class directly. Instead, you create a factory object in the initialization section of the unit that contains the class declaration. The factory object will then create the ActiveX control object when asked to by the system.

In addition to the interfaces inherited from TAutoObject, TActiveXControl implements the following interfaces:

Note: See the DelCtrls demo in ..\ActiveX\Delctrls for an example of using VCL components as ActiveX controls.

See Also