InfoConnect API Guide
Attachmate.Reflection.UserControl.IbmHosts Namespace / IbmTerminalControl Class / InitInstance Method / InitInstance(String) Method
The session path.
Example


In This Topic
    InitInstance(String) Method
    In This Topic
    Initializes this terminal instance with an existing session file.
    Syntax
    'Declaration
     
    
    Public Overloads Sub InitInstance( _
       ByVal sessionFilePath As String _
    ) 
    'Usage
     
    
    Dim instance As IbmTerminalControl
    Dim sessionFilePath As String
     
    instance.InitInstance(sessionFilePath)
    public void InitInstance( 
       string sessionFilePath
    )

    Parameters

    sessionFilePath
    The session path.
    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
    Open a session document file to initialize a terminal user control and then check for initialization errors
    private void Form1_Load(object sender, EventArgs e)
    {
        ibmTerminalControl1.InitInstance(Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\demo.rd3x");
    }
     
    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;
        }
     
    }
    See Also