Calling .NET from COBOL

ACUCOBOL-GT gives you access to .NET assemblies, both graphical and non-graphical, including user controls and Windows forms controls. You do not need to know object-oriented programming or the NET Framework.

This interface includes a graphical utility known as the .NET Definitions Generator, or NETDEFGEN.exe. This utility allows you to view and select .NET assemblies for translation to a COBOL COPY file. COBOL programmers already familiar with the DISPLAY, CREATE, MODIFY, INQUIRE, and DESTROY statements can immediately write COBOL programs that consume .NET assemblies.

The runtime starts the .NET CLR, loads and executes the requisite .NET components, and returns the results to the COBOL program. There is a runtime configuration variable for tracing the CLR control module: NET_FILE_TRACE. To turn on tracing set NET_FILE_TRACE to 1. This creates NetTraceFile.txt in the directory where atermmgr.dll is located. The Default is 0 [off].

The next section provides details on adding and using .NET assemblies in COBOL programs by using NETDEFGEN and AcuToNET.dll.

Note: ACUCOBOL-GT requires Microsoft .NET Development Framework Version 2.0. However, with NETDEFGEN, you can process Version 1.0 - 3.5 assemblies.
Note: Prior to version 9, the AcuToNet.dll was used to provide .NET support. By default, this interface is no longer needed in versions 9 or higher of ACUCOBOL-GT. A new internal method of .NET support was added to version 9 that enables greater .NET support than what could be achieved with the previous AcuToNet.dll method. However, if you experience issues with the new method you can revert to using the AcuToNet.dll method. See Using the AcuToNet.dll interface for instructions.