Class ActiveXObject() Foundation

Class function of the ActiveXObject class

Superclass
Description

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
:create()
Creates an ActiveXObject and connects it to a COM/ActiveX object.
Life cycle
:destroy()
Disconnects from a COM/ActiveX component.
COM/ActiveX Event Management
:fireEvent()
Fires a COM/ActiveX event.
:suspendEvent()
Suspends event processing for a COM/ActiveX event.
:resumeEvent()
Resumes event processing for a COM/ActiveX event.
:isEventPublished()
Determines whether an event is published by the COM/ActiveX object connected.
:isEventSubscribed()
Determines whether a COM/ActiveX event has been subscribed to.
:subscribeEvent()
Subscribes to a COM/ActiveX event.
:unsubscribeEvent()
Unubscribe from a COM/ActiveX event.
:comDefaultHandler()
Default handler for processing COM/ActiveX events.
Examples
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 
oObj:destroy() 

... 
Feedback

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.