


Appendix C in the ACUCOBOL-GT Reference Manual 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.exe" that contains your routines.
In order to build a new runtime, you must have the ACUCOBOL-GT 32-bit development system and Visual C++ installed properly. The files that you need to rebuild the runtime can be found in the "library" subdirectory off the main ACUCOBOL-GT directory. Change to that directory and type:
NMAKE -f WRUN32.MAK
If everything is installed correctly, you should see the steps occurring as a new runtime system is built, and you should end up with a new "wrun32.exe" file.
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 names of your files to the line labeled "SUBS=" in the "makefile.nt" file. Note that you actually add the name of the corresponding ".obj" file, not the ".c" source file.
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.