Class ActiveXObject() Foundation

Class function of the ActiveXObject class


The class ActiveXObject is a part of Xbase++'s automation support sub-system. Building on functionality inherited by its base class AutomationObject, class ActiveXObject introduces an easy-to-use protocol for integrating automation objects generating COM/ActiveX events. Using an ActiveXObject, an Xbase++ application can react to events sent by the automation server built into the MS Outlook application. This allows the application to notify the user when an e-mail arrives in the in-basket, for example.

In order to use an ActiveX component capable of generating events, an application usually uses an instance of the ActiveXObject class to create the component. After the component has been created, code blocks for handling events can be assigned to callback slots provided by the ActiveXObject instance. In addition, event handler methods can be implemented in classed derived from ActiveXObject. Event handler methods are called automatically whenever the corresponding COM/ActiveX event is generated by the ActiveX component connected to the ActiveXObject instance.

Class methods
Creates an ActiveXObject and connects it to a COM/ActiveX object.
Life cycle
Disconnects from a COM/ActiveX component.
COM/ActiveX Event Management
Fires a COM/ActiveX event.
Suspends event processing for a COM/ActiveX event.
Resumes event processing for a COM/ActiveX event.
Determines whether an event is published by the COM/ActiveX object connected.
Determines whether a COM/ActiveX event has been subscribed to.
Subscribes to a COM/ActiveX event.
Unubscribe from a COM/ActiveX event.
Default handler for processing COM/ActiveX events.
Example for using a callback code block to react to a COM/ActiveX event
// Create an ActiveXObject instance 
// for an ADODB component 
oObj := ActiveXObject():create( "ADODB.Connection" ) 

// Register an event handler code block for 
// a COM/ActiveX event named "OnSourceChange" 
oObj:OnSourceChange := {|| MsgBox("Data source was changed!") } 

// Destroy the ActiveX object 


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.