Using Visual Basic Forms and Related Files

You can use the Active Expert Application Builder to generate a Visual Basic form and project file on an operation (a TUXEDO service). You can configure the form (on the Default Form Options window) to contain the declaration, usage, and cleanup code from the Workstation Objects window. This code is generated into the appropriate event handlers for the form. Exporting your client source code to a Visual Basic form is a convenient way to run and test a particular TUXEDO service during development.

With simple automation server objects, only the Visual Basic form (.frm file) is necessary. ActiveX controls require the generation of the Visual Basic project file (.vbp file), and a binary (.frx file) that contains information about the control.

The following sections describe:

Setting Default Form Options

You can set options that indicate how the Application Builder generates forms. For example, you can specify that forms always include test code and that a project file is generated along with the form.

To set Default Form options:

  1. Choose Tools->Options from the menu bar (or use keyboard shortcut Alt T O).

  2. Click on the Default Form tab.

    This brings up the default options window for Visual Basic forms and project files.

    Figure 3-13 Default Form Options

    The following table explains the options available on the Default Form options window.

    Table 3-7 Default Form Options

    Topic Section Field Description

    Form Options

    Generate Test Code checkbox

    Indicates whether you want to generate code from the Workstation Objects window (Declarations, Usage, Cleanup code) into a Visual Basic form automatically when a new default form is generated. (In the figure, this is on.)

    Generate Project File checkbox

    Indicates whether you want to generate a Visual Basic project file whenever you generate a form. (In the figure, this is on.)

    Visual Basic Version

    Indicates whether you want to generate a form for Visual Basic 4.0 or 5.0

    Housekeeping

    Location

    Indicates the default location to which Visual Basic forms are generated.

    If this directory does not exist, the Application Builder prompts you when you try to generate a default form and gives you the option of generating the form into the current directory.

    Confirm on overwrite

    Enables or disables a confirmation prompt when a given form, project, or .frx file already exists. (In the figure, this is on.)

  3. When you have filled in the fields, click OK to save your changes and close the window. (You can also click Cancel to close the window without saving.)

Generating a Visual Basic Form

To generate a Visual Basic form for an operation:

  1. In the Workstation Objects window, select an operation.

  2. Choose Tools->Generate Default Form from the menu bar

    Or

    Choose Generate Default Form from the popup menu on the operation (right mouse click to get popup menu).

    (The keyboard shortcut to generate a form on an operation is Alt T F.)

    This causes a Visual Basic form to be generated on the selected operation. The form is saved in the default location showing for the Default Form options.

    If you set options to generate a project file as well, the project file is also saved in the default location. (Project files have a .vbp extension.) If the interface is an ActiveX control (.OCX), a .frx file is also generated.

See also help on the Default Form Options.