COBOL projects that compile to native code
Visual COBOL enables you to create projects for applications that compile to native code. For example, the following native project templates,
among others, are supplied:
- Console Application (native COBOL)
- Adds the items needed to create a console application. Console applications are typically designed without a graphical user
interface and are compiled into a stand-alone executable file. A console application is run from the command line with input
and output information being exchanged between the command prompt and the running application.
- Enterprise Server Application
- Creates a COBOL project that supports COBOL-based service interfaces with the IMTK.
This template is available only when the
Enterprise Server feature is enabled.
- INT/GNT (native COBOL)
- Creates an empty project for INT/GNT code and offers project properties specific to the .int and .gnt file types.
- Unit Test Library
- Creates a project and test program for use with the
Micro Focus Unit Testing Framework.
COBOL projects that compile to .NET managed code
Visual COBOL includes a number of project templates for creating .NET managed code applications.
In most cases, you need to use the standard managed project templates (which excludes the Procedural Multi-Output Project)
which compile all the programs within the project into a single assembly. When using multiple projects within your application,
you might need to preload the target assembly before calling a subprogram. See
Calling Entry Points in Subprograms for details on how to preload modules.
Some of the standard managed COBOL project templates include:
- Class Library (managed code)
- Creates reusable classes and components that can be shared with other projects. Typically, this is built into a
.dll file.
- Windows Forms Application (managed code)
- Creates an empty Windows form and skeleton COBOL code behind the form. It adds the necessary .NET Framework classes, such
as System.Windows.Forms to the project references. It creates default project properties.
- WPF Application (managed code)
- Creates a COBOL client application for User Interfaces that uses the WPF (Windows Presentation Foundation) presentation features.
When dealing with large numbers of source files, for example in an existing native application which you want to compile to
managed code, it may be preferable to use the Procedural Multi-Output Project which is a special type of a .NET project. It
creates a single assembly for each individual program within the project. In this way, when calling a subprogram, the COBOL
run-time system can locate the assembly using the name of the called program which will match the assembly file name. In this
case, the assembly does not have to be preloaded.
You can use this template to move some existing applications to
Visual COBOL and to managed code. These applications rely on the mechanism within native code described earlier, for example, an .INT
or .GNT application, and where code changes to preload modules are not desirable.
- Procedural Multi-Output Project (managed code)
- Creates an empty managed project with multi-output assembly support for compiling procedural programs to individual managed
assemblies or executables. Every compiled program includes the references specified for the project in Solution Explorer,
and under the References node.
Note: Using this template can result in a large number of managed assemblies which means deployment of the application might not
be straightforward. You might need to consider consolidating programs into fewer assemblies which may ease the distribution
and maintenance of your application.
The following limitations apply to this project type:
- Adding managed resources such as classes, WinForms, resources, Service References, Web References is not supported. You need
to create these in a separate managed project and reference that project from within the Procedural Multi-Output project.
- The programs generated from the procedural multi-output project cannot be referenced from other managed projects, nor can
they be referenced using object COBOL syntax. However, a multi-output project supports adding references to other types of
managed projects.
Projects for creating COBOL Azure cloud services
Visual COBOL includes a project for creating COBOL Azure cloud services. The Windows Azure Tools must be installed. See the
Additional Software Requirements for information about all prerequisites.
SQL Server Database project
The
SQL Server Database Project creates a COBOL project that enables you to create SQL CLR stored procedures, and a .Publish project that you can use to
publish your SQL CLR stored procedures directly to a SQL Server database.:
Projects for creating COBOL applications for the Web
A number of project templates for creating COBOL applications with a Web user interface, or COBOL web services, are available.
For example:
- ASP.NET Web Application
- Creates a COBOL application that you deploy on the Web using the Visual Studio deployment tools.
- WCF Service Application (managed code)
- Creates a project for building a service-oriented COBOL applications. The WCF (Windows Communication Foundation) services
consist of a number of operations which you can expose to client applications through different endpoints . This template
is not available in Visual Studio Shell.
- WCF REST Service Application
- Creates a COBOL WCF REST Application service. This project type requires a more advanced edition of Visual Studio such
as the Visual Studio Shell does not support WCF applications. It also requires versions of the .NET Framework 4.0 and
later. For more information about WCF and REST, check the Microsoft MSDN.
Projects for creating Dialog System applications
The following project templates are available:
- Dialog System Application (Modern) for creating Dialog System applications with modern look and feel that use Microsoft's visual styles by default.
- Dialog System Application (Classic) for creating Dialog System applications that use the classic fonts and look.