|
See the section entitled "Using Distinct ActiveX controls in various environments" on how to add the control to your project.
After placing a VT220 control into a form, some properties can be preset at design time. The Port property defaults to server port 23 (the default Telnet port) and may be changed at design time or at
run time before a connection is established. The Host property is usually set at run time right before a session is established. This allows the application to request the host name or internet
address of the remote server from the user. If an application will always connect to the same host, then the Host property can also be set at design time to minimize user interaction. If an
application will handle the connection itself, then the Port and Host properties are not used.
The VT220 ActiveX control contains a VT220 emulation window, which is created when the Initialize method is called (or the Action property is set to ACTION_INITIALIZE) (usually while the parent form
is loaded at run time). Once the VT220 emulation window is created, the application can choose to establish the connection itself or to allow the VT220 ActiveX control to take care of handling the
connection.
To allow the VT220 ActiveX control to take care of handling the connection, the connect method is called (or the value of the Action property must be set to ACTION_CONNECT.) Before a connection can
be made the Host and Port properties must be set up to specify the remote server and port to connect to. If the connection can be established, then the OnConnect event will occur before the next line
of code is reached. At this point, the VT220 control will handle all emulation and will transfer data to and from the remote server. In this case, the application has no control over the data being
transferred.
If an application requires more control over the data being transferred, then the application can establish its own connection directly or by using other ActiveX controls (such as the Distinct
Windows Sockets ActiveX control). In this case, it is the application's responsibility to send and receive data. The application must use the WriteData property to display data it received from the
remote server in the emulation window and the VT220 ActiveX control will deliver user input (key strokes) to the application through OnData events. Then, the application must send the user input to
the remote server. This approach is useful if the application wants to filter or change unwanted characters from the server before they are displayed. It is also possible to change user keystrokes
(for example, to expand macros) before sending them to the server.
Most of the VT_ actions can only be performed once the emulation window has been created by calling the Initialize method (or using ACTION_INITIALIZE). There are some operations such as listing,
modifying, deleting and saving configuration profiles, achieved by calling the ListConfig, ModifyConfig, DeleteConfig and SaveConfig methods, which can be called before a VT session is initialized.
The VtAction property allows the application to configure the terminal; set the color and font; select a printer; remap keys; perform clipboard operations; list existing configurations or to modify,
add, save and delete configurations. Most of these operations can also be achieved by using the corresponding methods.
The boolean properties CopyClipboard, PasteClipboard, ClearClipboard, CaptureScreen, CaptureScreenFile, CaptureData, CaptureDataFile, InCaptureData, InCaptureDataFile, TransModeStatus and
SaveSettings can be used by the application to determine whether an operation is allowed at that particular moment. The operation can only be performed if the corresponding boolean property is TRUE.
The boolean properties are read-only and cannot be set at any time.
The application can create a number of session configuration profiles. The ConfigurationName property must be set to the name of the terminal configuration that the application will use for the
session. The application can save the current terminal settings as a configuration and then load this configuration as the terminal settings for another session. To obtain a list of all available
configurations, call the ListConfig method (or set the VtAction property to VT_LIST_CONFIGURATION.) One or more OnList events will occur to deliver the names of all defined configurations.
The CurrentFont property specifies the font currently in use. To use a different terminal font, set the CurrentFont property to a different value.
The CaptureAppend property determines whether the contents of the file specified by the CaptureFile property be overwritten or appended during a screen or data capture.
The Row and Column properties specify the current cursor location on the terminal window.
The ShowHelp property determines whether the VT220 ActiveX control should show or hide the help buttons in the dialog boxes it displays.
If the application does not handle the connection itself, then it must close the connection once it is no longer needed by calling the Disconnect method (or setting the Action property to
ACTION_DISCONNECT.) After the session is disconnected, the OnClose event will occur before the next line of code is reached. An application can connect (ACTION_CONNECT or Connect method) and
disconnect (ACTION_DISCONNECT or Disconnect method) a session (with the same or a different server) as often as needed. Before terminating the application, it must also destroy the VT220 emulation
window by calling the Destroy method (or setting the Action property to ACTION_DESTROY).
|