--netdll

The " --netdll" compiler option generates a .NET dynamic link library (DLL) that gives .NET assemblies–both executables and DLLs–a programmatic interface to your COBOL program. All COBOL entry points are exposed as .NET methods along with ACUCOBOL-GT runtime properties and methods. This allows .NET programmers to set ACUCOBOL-GT command options and call runtime interfaces from their .NET assembly.

By referring to an ACUCOBOL-GT .NET DLL in a project solution, .NET programmers can view ACUCOBOL-GT runtime properties, runtime initialization and control methods, COBOL entry points, the main COBOL entry point, and Linkage section parameters in the Visual Studio .NET object browser.

Three files are created when you compile a COBOL program using the "--netdll" option. All three begin with the program file name. For example, the compiler command:

ccbl32 --netdll MyProgram.cbl

results in "MyProgram.dll," "MyProgram.netmodule," and "MyProgram_CVM.dll." .NET programmers would reference "MyProgram.dll" and "MyProgram_CVM.dll" in their project.

"MyProgram_CVM.dll" contains all the COBOL program entry points and ACUCOBOL-GT runtime interfaces exposed as .NET methods. ACUCOBOL-GT runtime options are exposed as properties.

The class in "MyProgram.dll" derives from class CVM which resides in "MyProgram_CVM.dll" allowing the instantiation of namespace class "MyProgram.MyProgram myPgm = new MyProgram.MyProgram()". All methods and properties in "MyProgram_CVM.dll" class CVM are exposed to object "myPgm".

"MyProgram.netmodule" contains ACUCOBOL-GT setup routines that are automatically executed during object instantiation. "MyProgram.dll" works in conjuction with "MyProgram.netmodule" to perform this task. The namespace and class are always generated using the COBOL file name without the extension. In this case the namespace and class are "MyProgram.MyProgram".

As mentioned previously, COBOL entry names and the main COBOL program entry point generate .NET methods. Method parameters are generated when entry statements contain USING parameters or a Procedure Division statement contains USING parameters. There are two additional parameters added to each generated .NET method. They follow all the COBOL USING parameters for the entry name or Procedure Division statement. The first parameter, string, is for program execution command parameters. They are "-d" (debug) and "-cache". All other runtime command options must be set via properties before calling AcuInitialize or in the string parameter of AcuInitialize.

The second parameter is for a return code. This is the return code from the COBOL program. The method return code is from the COBOL Virtual Machine interface and is documented in CVM Class. You can also view the values using the Visual Studio .NET object browser under ErrorTypes in class CVM.

Note:

All of the criteria that apply to the CVM class also apply to the .NET component. See CVM Class for details on these criteria.