GetObject
In Reflection 2008, GetObject calls can only support one type of legacy object, based on your Legacy API preference. For example, if you want GetObject to return the EXTRA! session object instead of the legacy Reflection session object, you will need to specify EXTRA! as the preferred API type in the Legacy API preference. For more information, see the Reflection 2008 Help.
- In this example, GetObject attaches to a running instance of Reflection 2008 by using the Automation server name (the default AutomationServerName value "Reflection Workspace"). This technique allows you to identify a particular Reflection 2008 instance even if multiple Reflection 2008 instances are active.
Dim ApplicationObject As Attachmate_Reflection_Objects_Framework.ApplicationObject
Set ApplicationObject = GetObject("Reflection Workspace")
ApplicationObject.CreateControl("C:\Users\[Username]\Documents\Attachmate\Reflection\MySession.rd5x")
- In this second example, GetObject attaches to a running instance of Reflection 2008. The comma after GetObject indicates that the first argument has been omitted. The line continuation character, an underscore preceded by a space, is used to break up the long line of code.
Dim App As Attachmate_Reflection_Objects_Framework.ApplicationObject
Set App = GetObject(, _ "Attachmate_Reflection_Objects_Framework.ApplicationObject")
- In this last example, GetObject opens a new instance of Reflection 2008 by returning a reference to the ApplicationObject object. The first argument includes an empty string. The line continuation character, an underscore preceded by a space, is used to break up the long line of code.
Dim App As Attachmate_Reflection_Objects_Framework.ApplicationObject
Set App = GetObject("", _ "Attachmate_Reflection_Objects_Framework.ApplicationObject")
|