Embedding Terminal User Controls > Using the IBM Terminal User Control |
The Reflection IBM Terminal User Control can be embedded in your Windows applications to provide a terminal screen on a Windows form along with another application or a different data source. This control renders a terminal emulator session within a given windows form application.
Note: When creating applications on a 64-bit machine and using Reflection "Terminal Controls", make sure the application target is set to "x86" instead of "Any CPU" or "x64". This is required because a 64-bit application does not work directly with 32-bit controls. If the build target (Platform) is not set to "x86", the "COMException: class not registered" error is displayed during runtime.
To set up the IBM terminal User Control
Note: The required assemblies are automatically added to the project references after you add the control to the form.
private void Form1_Load(object sender, EventArgs e)
{
ibmTerminalControl1.InitInstance(Attachmate.Reflection.UserControl.IbmHosts.HostType.IBM3270);
}
private void ibmTerminalControl1_TerminalInitializedEvent(object sender, AsyncCompletedEventArgs e)
{
ibmTerminalControl1.IbmTerminal.HostAddress = "yourHostName";
ibmTerminalControl1.IbmTerminal.Connect();
}
Note: For details on the IbmTerminal object returned from the IbmTerminal control, see the Reflection .NET API Help.
Note: If you are developing an application with Visual Studio 2010 that is targeted to the .NET 4.0 framework, you may see the following compiler warning:
Warning A reference was created to embedded interop assembly 'c:\Windows\assembly\
GAC_MSIL\Reflection\15.4.0.0__13bff1b6907eadcf\Reflection.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\Attachmate\Reflection\Programmer Interfaces\Attachmate.Reflection.UserControl.IbmHosts.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
The simplest way to resolve this warning is to set the Embed Interop Types property of the Reflection Reference to False. For more about how to resolve this warning, see Technical Note 2579.