Using the C API in Windows

You can use the C API for calling ACUCOBOL-GT programs on Windows, as well as on UNIX/Linux systems. Call the ACUCOBOL-GT runtime DLL from other languages in one of two ways.

  1. Use the functions acu_initv(), acu_cobol(), acu_shutdown(), and others fully described in the topic, Function Reference.

    These functions offer more control and are designed to be called from C. They are portable between Windows and UNIX; the same C source code calling ACUCOBOL-GT on Windows compiles and runs on UNIX.

  2. Use the corresponding functions, AcuInitialize(), AcuCall(), AcuShutdown() and so on, that are described in the topic Calling the Runtime DLL.

    These functions are designed for use with programming languages like VisualBasic that use Variant type arguments. For example:

    extern void  __stdcall AcuRunMain(char *command_line);

    In Visual Basic, for example, the declaration is:

    Declare Function AcuRunMain Lib "wrun32.dll" _
       (ByVal cmdLine As String)

    This has the same functionality and use as acu_runmain(). It is optional to call AcuInitialize before AcuRunMain. For example:

    if ( AcuInitialize(lpCmdLine) >= 0 )
       AcuRunMain(lpCmdLine);