InfoConnect API Guide
Attachmate.Reflection.UserControl.IbmHosts Namespace / IbmTerminalControl Class / InitInstance Method / InitInstance(HostType) Method
Host type for the new session
Example


In This Topic
    InitInstance(HostType) Method
    In This Topic
    Initializes this terminal instance with a given HostType.
    Syntax
    'Declaration
     
    
    Public Overloads Sub InitInstance( _
       ByVal hostType As HostType _
    ) 
    'Usage
     
    
    Dim instance As IbmTerminalControl
    Dim hostType As HostType
     
    instance.InitInstance(hostType)
    public void InitInstance( 
       HostType hostType
    )

    Parameters

    hostType
    Host type for the new session
    Remarks

    The InitInstance call is required to initialize the terminal user control with sufficient information to render a terminal user interface.

    Use the TerminalInitializedEventHandler to check for any errors that may have occurred during terminal initialization.

    Example
    Initialize a terminal user control and check for errors before setting the host address and connecting
    private void Form1_Load(object sender, EventArgs e)
    {
        ibmTerminalControl1.InitInstance(Attachmate.Reflection.UserControl.IbmHosts.HostType.IBM3270);
    }
     
    private void ibmTerminalControl1_TerminalInitializedEvent(object sender, AsyncCompletedEventArgs e)
    {
        // Check if error occurred during the terminal initialization
        if (e.Error != null)
        {
            MessageBox.Show("Error during terminal initialization step: " + e.Error); return;
        }
     
        ibmTerminalControl1.IbmTerminal.HostAddress = "yourHostAddress";
        ibmTerminalControl1.IbmTerminal.Port = 23;
        ibmTerminalControl1.IbmTerminal.Connect();
    }
    See Also