InfoConnect API Guide
Attachmate.Reflection.Framework Namespace / MyReflection Class / Start Method / Start() Method
Example


In This Topic
    Start() Method
    In This Topic
    Starts a visible Reflection application instance when the Reflection Workspace "API Settings" .Net API option is enabled.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function Start() As Guid
    'Usage
     
    
    Dim value As Guid
     
    value = MyReflection.Start()
    public static Guid Start()

    Return Value

    Reflection instance ID.
    Remarks

    This method returns an instance ID of type Guid if the call is successful; otherwise an exception is thrown. The returned instance ID uniquely identifies the application instance and is used as an input parameter in ForceStop(Guid instanceId) to stop the instance. (Use the ForceStop() method only after the Close() method fails.

    To create an application object for the first application instance you create, use CreateApplication("Reflection_yourUserID"). For example, if your user ID is �SmithJ�, the channel name for the first application instance you created with Start() would be �Reflection_SmithJ�.

    If you need to create application objects for more than one application instance, use the overloaded version, Start(string channelName), to create a known unique channelName for each application instance.

    Example
    The following example shows how to start a new application instance:
    using Attachmate.Reflection.Emulation.IbmHosts;
    using Attachmate.Reflection.Framework;
    using Attachmate.Reflection.UserInterface;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ApplicationInstanceID
    {
        class Program
        {
    
            static void Main(string[] args)
            {
                //Start a visible workspace instance
                MyReflection.Start();
    
                //Create an application that represents the instance of the workspace that was just started or is running at the default IPC channel
                Application app = MyReflection.CreateApplication();
    
                //Create a terminal for an Ibm 3270 session
                IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(new Guid("{09E5A1B4-0BA6-4546-A27D-FE4762B7ACE1}"));
    
                //Specify the host name or IP address and connect.
                terminal.HostAddress = "demo:ibm3270.sim";
                terminal.Port = 623;
                terminal.Connect();
    
                //Create a View to make the session visible                
                IFrame frame = (IFrame)app.GetObject("Frame");
    
    
                frame.CreateView(terminal);
    
    
                Console.ReadLine();
            }
        }
    }
    
    
    See Also