Establishes an event handler for an ActiveX event.
REGISTEREVENT(object, "eventname", "handlername")
object |
- |
A handle to an ActiveX object. |
"eventname" |
- |
A string, the name of the ActiveX event. |
"handlername" |
- |
A string, the name of the routine that is called when the event is raised. Typically an SPL function. |
REGISTEREVENT(object, eventID, "handlername")
object |
- |
A handle to an ActiveX object. |
eventID |
- |
An integer, the ID of the the ActiveX event. |
"handlername" |
- |
A string, the name of the routine that is called when the event is raised. Typically an SPL function. |
An integer, 1 if successful.
Consider the following SPL function:
The handler can be used to process events from Internet Explorer.
Each time the title displayed by Internet Explorer changes, MyEvent is called and a message box is displayed.
The event can also be specified by an integer event ID. For example:
The ActiveX event can be specified by name or integer ID.
Depending on the particular event, zero or more arguments may be passed to the event handler.
See GETCONTROL to return a handle to the calling ActiveX object.
See UNREGISTEREVENT to cancel an event handler
See RAISEEVENT and FIREEVENT to fire an event from DADiSP to an external client application.
REGISTEREVENT can also be called SETEVENTHANDLER.