Walkthroughs > Add the Terminal User Control > Set up the WPF Terminal User Control |
The InfoConnect Windows Presentation Foundation (WPF) Terminal User Control can be embedded in your WPF applications to provide a terminal screen on a window along with another application or a different data source. This control renders a terminal emulator session within a given WFP application.
![]() |
Note: You can use the InfoConnect WPF Terminal User Control with Visual Studio 2013 targeted to .NET 4.5.1 or with Visual Studio 2010 targeted to the .NET 4.0 framework (or higher .NET versions supported by Visual Studio 2010). When creating applications on a 64-bit machine and using InfoConnect "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. |
Change:
<Grid>
<IbmHosts:IbmTerminalControl x:Name="ibmTerminalControl1"
HorizontalAlignment="Left" Margin="191,188,0,0"
VerticalAlignment="Top"/>
</Grid>
To:
<Grid>
<IbmHosts:IbmTerminalControl x:Name="ibmTerminalControl1" />
</Grid>
private void Window_Loaded(object sender, RoutedEventArgs e) { ibmTerminalControl1.InitInstance(Attachmate.Reflection.UserControl.Wpf.IbmHosts.HostType.IBM3270); }
private void Window_Loaded(object sender, RoutedEventArgs e) { openSystemsTerminalControl1.InitInstance(); }
using Attachmate.Reflection.Emulation.OpenSystems;
private void ibmTerminalControl1_TerminalInitializedEvent(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { ibmTerminalControl1.IbmTerminal.HostAddress = "zos.efglobe.com"; ibmTerminalControl1.IbmTerminal.Port = 23; ibmTerminalControl1.IbmTerminal.Connect(); }
private void openSystemsTerminalControl1_TerminalInitializedEvent(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { ITerminal Terminal = openSystemsTerminalControl1.Terminal; ((IConnectingSettingsBestNetwork)Terminal.ConnectionSettings).HostAddress = "yourHostName"; Terminal.Connect(); }
![]() |
Note: You may see the following compiler warning: Warning A reference was created to embedded interop assembly 'c:\Windows\assembly\ GAC_MSIL\InfoConnect \<version>__13bff1b6907eadcf\Reflection.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files (x86)\Attachmate\InfoConnect \Programmer Interfaces\Attachmate.Reflection.UserControl.wpf.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 InfoConnect Reference to False. For more about how to resolve this warning, see Technical Note 2579. |