Using the ActiveX Control on a Web Page

This web page contains a Reflection for HP Control. When the page is loaded, GetActiveSession is used to create a Reflection Session object. This object is used to configure a demonstration session. Commented out code shows how you could accomplish the same thing with the control's Command method. A button on the page uses the Command method to display the Connection Setup dialog box. Commented out code shows how you could accomplish the same thing with GetActiveSession.

<HTML>

 

<HEAD>

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

</HEAD>

 

<BODY>

 

<H2>Reflection for HP ActiveX Demo </H2>

 

<DIV>

<input type = "submit"

value="Connection Setup"

onclick="ConnectionSetup()">

</DIV>

 

<BR>

 

<OBJECT ID ="R1winCtrl"

 CLASSID="clsid:15B168B2-AD3C-11d1-A8D8-00A0C9200E61"

 WIDTH=380

 HEIGHT=280>

</OBJECT>

 

<SCRIPT LANGUAGE="VBScript">

<!--

 

Dim ReflectionHP 'Reflection object assigned to the active session

 

Sub Window_OnLoad() 

 

'Setting up the Reflection connection

 

'Technique #1: Create a Reflection Session Object

Set ReflectionHP = R1winCtrl.GetActiveSession

With ReflectionHP

.ConnectionType = "DEMONSTRATION"

.ConnectionSettings = "Host ""HP 3000"""

End With

 

'Technique #2: Use the control's Command method

'R1winCtrl.Command ".ConnectionType = ""DEMONSTRATION"" "

'R1winCtrl.Command " .ConnectionSettings = ""Host 'HP 3000'"" "

 

End Sub

 

Sub ConnectionSetup()

 

'Display the Connection Setup dialog box.

R1winCtrl.Command ".ExecuteBuiltInFunction ""ConnectionSetup"" "

 

'Alternative syntax to do this using the Session object

'Set ReflectionHP = R1winCtrl.GetActiveSession

'ReflectionHP.ExecuteBuiltInFunction "ConnectionSetup"

 

End Sub

-->

</SCRIPT>

 

</BODY>

</HTML>