CreateControl(Guid) Method
Creates a control by its Guid type.
This sample shows how to create a new terminal control
using System;
using System.Collections.Generic;
using System.Text;
using Attachmate.Reflection.Framework;
using Attachmate.Reflection.Emulation.IbmHosts;
using Attachmate.Reflection.UserInterface;
namespace CreateASession
{
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 for an Ibm 3270 session
IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(new Guid("{09E5A1B4-0BA6-4546-A27D-FE4762B7ACE1}"));
//Specify the host name or IP address
terminal.HostAddress = "demo:ibm3270.sim";
//To create a 5250 terminal, use the following lines to get a terminal and specify the host name
//IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(new Guid("{AF03A446-F278-4624-B9EF-C896DF2CA1CA}"));
//terminal.HostAddress = "demo:ibm5250.sim";
//Specify the port number and connect
terminal.Port = 623;
terminal.Connect();
//Create a View to make the session visible
IFrame frame = (IFrame)app.GetObject("Frame");
frame.CreateView(terminal);
}
}
}