Building a New Runtime

Working with C and C++ Programs covers the details of writing C subroutines and passing parameters between those routines and COBOL. You may use any of the interface methods described there to call your C routines.

After you've written your routines, you'll need to link them into the runtime system. This process builds a new "wrun32.dll" that contains your routines.

In order to build a new runtime, you must have the ACUCOBOL-GT Windows runtime and Visual C++ .NET installed. The files that you need to rebuild the runtime can be found in the "library" subdirectory of the main ACUCOBOL-GT directory. To link, load "wrun32.sln" into Visual C++ .NET and perform a build. For more information, see Working with C and C++ Programs.

Important tips before you rebuild the runtime

You may add your C routines directly to the "sub.c" or "mswinsub.c" files provided with ACUCOBOL-GT. More likely, you'll want to create your own files that hold your routines. If you do this, add the files to the "wrun32" project.

The file "mswinsub.c" contains useful declarations that you may want to use in your C subroutines. In particular, you will find variables for the "instance" and "main window" handles used by ACUCOBOL-GT. Also, you will find a start-up routine to which you can add your initialization code.