Reflection
GetObject(String) Method
Example 


The object moniker used to get the object.
Get an object by the object moniker.
Syntax
'Declaration
 
Public Function GetObject( _
   ByVal objectMoniker As String _
) As Object
'Usage
 
Dim instance As Application
Dim objectMoniker As String
Dim value As Object
 
value = instance.GetObject(objectMoniker)
public object GetObject( 
   string objectMoniker
)

Parameters

objectMoniker
The object moniker used to get the object.

Return Value

The object.
Remarks
Gets an object by its object moniker. Objects represent major functional areas. See each supported object's documentation for its moniker. Currently, Frame is the only supported object moniker.
Example
The following example shows how to get the Frame object.

using System;
using System.Collections.Generic;
using System.Text;
using Attachmate.Reflection.Framework;
using Attachmate.Reflection.Emulation.IbmHosts;
using Attachmate.Reflection.UserInterface;

namespace OpenASession
{
    class Program
    {
        static void Main(string[] args)
        {
            //Start a visible instance of Reflection or get the instance running at the given channel name
            Application app = MyReflection.CreateApplication("myWorkspace", true);

            //Create a terminal from the session document file
            string sessionPath = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\Reflection\gettingStarted.rd3x";
            IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(sessionPath);

            //Make the session visible in the workspace
            IFrame frame = (IFrame)app.GetObject("Frame");
            frame.CreateView(terminal);
        }
    }
}  
                                 

                                        
See Also