Responding to events using the ActiveX Control on a Web Page

This web page contains a Reflection for UNIX and OpenVMS ActiveX Control. When the page loads:

· The Reflection control is configured to connect to a demonstration host.

· An event is defined using the OnEvent method. This event triggers the RaiseControlEvent method.

When you display the page and connect to the host (by clicking the connect button), the event procedure uses OnReflectionEvent to display the string data sent from Reflection.


<TITLE>Reflection ActiveX Control Demonstration Page</TITLE>



<H2>Reflection for UNIX and OpenVMS ActiveX Demo </H2>


<OBJECT ID ="R2winCtrl"









Dim RUD 'Reflection object assigned to the active session


'Define constants used by the Reflection Session object

const rcNextEvent = 0

const rcEvConnected = 2

const rcVBCommand = 9

const rcEnable = 1

const rcEventReenable = 1


Sub Window_OnLoad() 


Set RUD = R2winCtrl.GetActiveSession

With RUD

'Configure connection

.ConnectionType = "DEMONSTRATION"

.ConnectionSettings = "Host ""UNIX"""


'Define an event to take place when a connection is made

.OnEvent rcNextEvent, _

rcEvConnected, _

rcVBCommand, _

"RaiseControlEvent 1, ""Connected!"" ", _

rcEnable, _



End With


End Sub


Sub R2winCtrl_OnReflectionEvent(eventNumber, eventData)

Msgbox eventData, , "Reflection"

End Sub