Reflection
GetControlByInstanceId Method (Application)
Example 


The instance ID of the control.
Gets the control that matches a control instance ID if that control is running on this instance of Reflection.
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
System.ApplicationExceptionThe 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