|
-
April 22nd, 2005, 02:00 PM
#1
How can I create two session objects?
I'm having trouble creating two seperate sessions of WRQ Reflection for HP. My code for creating the first session works fine, but when I try to create the second session. I get errors like, Connection Type can't be changed.
Code:
Private Sub OpenSessionF1()
Dim isFound As Integer
Dim MyObjectF1 As Reflection1.Session
Set MyObjectF1 = CreateObject("Reflection1.Session")
MyObjectF1.Visible = True
With Session '<------------------------------------ I think my problem is here.
.ConnectionType = "BEST-NETWORK"
.ConnectionSettings = "Host 192.6.22.2"
.Connect
isFound = .WaitForString("MPE/iX", 0, rcAllowKeystrokes)
If isFound = False Then .Disconnect
End With
End Sub
Private Sub OpenSessionF2()
Dim isFound As Integer
Dim MyObjectF2 As Reflection1.Session
Set MyObjectF2 = CreateObject("Reflection1.Session")
MyObjectF2.Visible = True
With Session '<---------------------------------------Same Name so Same Session ??
.ConnectionType = "BEST-NETWORK"
.ConnectionSettings = "Host 192.6.22.2"
.Connect
isFound = .WaitForString("MPE/iX", 0, rcAllowKeystrokes)
If isFound = False Then .Disconnect
End With
End Sub
How do I assign a variable to the Session?
-
April 23rd, 2005, 06:43 AM
#2
Re: How can I create two session objects?
HAVE YOU TRIED CREATING A "NEW" OBJECT
Code:
Private Sub OpenSessionF1()
Dim isFound As Integer
Dim MyObjectF1 As NEW Reflection1.Session <=======================
Set MyObjectF1 = CreateObject("Reflection1.Session")
MyObjectF1.Visible = True
With Session '<------------------------------------ I think my problem is here.
.ConnectionType = "BEST-NETWORK"
.ConnectionSettings = "Host 192.6.22.2"
.Connect
isFound = .WaitForString("MPE/iX", 0, rcAllowKeystrokes)
If isFound = False Then .Disconnect
End With
End Sub
Private Sub OpenSessionF2()
Dim isFound As Integer
Dim MyObjectF2 As NEW Reflection1.Session <=====================
Set MyObjectF2 = CreateObject("Reflection1.Session")
MyObjectF2.Visible = True
With Session '<---------------------------------------Same Name so Same Session ??
.ConnectionType = "BEST-NETWORK"
.ConnectionSettings = "Host 192.6.22.2"
.Connect
isFound = .WaitForString("MPE/iX", 0, rcAllowKeystrokes)
If isFound = False Then .Disconnect
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|