Hi All,
I found a way to do what i needed. I just use the functions return value to send the object details back to the function call as shown below:
Form1.vb Form Code:
Code:
MySession1 = Attachmate_Extra.Session_Integration.Launch_Session("C:\Temp\", "one.edp")
Attachmate_Extra.vb Class Code:
Code:
Public Shared Function Launch_Session(ByVal Session_Path As String, ByVal Session_File As String) As Object
Code:
' Code to create the object i want and copy that object to the Launch_Session object so i can differentiate.
Return Launch_Session
If i make a second call to the Attachmate_Extra class from the form with a different session as below:
Code:
MySession2 = Attachmate_Extra.Session_Integration.Launch_Session("C:\Temp\", "two.edp")
I can then use a specific object by referencing to it as part of the call as below:
Code:
SendKeys_Result = Attachmate_Extra.Session_Integration.SendKeys_To_Session(MySession1, "The keys i want to send")
This sends the object to use to the function (In the Attachmate_Extra.vb class) as below:
Code:
Public Shared Function SendKeys_To_Session(ByVal Session_To_Use As Object, ByVal Keys_To_Send As String, Optional By Val Wait_Time As Short = 200) As Boolean
Not really along the lines of what i was asking but as i dont think it is actually possible to do the way i wanted this may be of use to others,
Gareth.