InfoConnect API Guide
Attachmate.Reflection.Framework Namespace / Application Class / GetControlByInstanceId Method
The instance ID of the control.
Example


In This Topic
    GetControlByInstanceId Method (Application)
    In This Topic
    Gets the control that matches a control instance ID if that control is running on this instance of the product.
    Syntax
    'Declaration
     
    
    Public Function GetControlByInstanceId( _
       ByVal controlInstanceId As Guid _
    ) As Object
    'Usage
     
    
    Dim instance As Application
    Dim controlInstanceId As Guid
    Dim value As Object
     
    value = instance.GetControlByInstanceId(controlInstanceId)
    public object GetControlByInstanceId( 
       Guid controlInstanceId
    )

    Parameters

    controlInstanceId
    The instance ID of the control.

    Return Value

    The control.
    Exceptions
    ExceptionDescription
    The API service can not intialize sucessfully.
    Remarks
    Gets a running terminal emulation session by its control instance ID. The method returns the control that has the instance ID that matches controlInstanceId.

    A control's instance ID is guaranteed to be unique. It does not persist in the session configuration file and its value changes between each session instantiation.

    Example
    private IIbmTerminal terminal;
    private Application app;
    app = MyReflection.CreateApplication();
    try
    {
       terminal = (IIbmTerminal)app.GetControlByInstanceId(new Guid("1517be80-ac73-4a8c-8ec8-602fbf39dcfc"));
    }
    catch
    {
       Console.WriteLine("Check to make sure the session with controlInstanceId is running.");
    }
    See Also