Compile and link programs with entry-names of GetExtensionVersion, HttpExtensionProc, and TerminateExtension as follows. In this explanation, the related files are Version.cob, MainProc.cob, and Terminate.cob. If you are using the project management function, use the build option in the Project Manager to compile and link these programs.
Compile the COBOL source program.
To compile a COBOL source program, either execute the WINCOB command in Project Manager to use the window operation or type a compilation command at the command prompt. This section provides an example of typing a compile command to compile a COBOL source program.
For details about compilation using the WINCOB command or a compile command, see the " NetCOBOL User's Guide."
COBOL32 -WC,"ALPHAL(WORD),THREAD(MULTI)" Version.cob COBOL32 -WC,"ALPHAL(WORD),THREAD(MULTI)" MainProc.cob COBOL32 -WC,"ALPHAL(WORD),THREAD(MULTI)" Terminate.cob
Note
Instead of the compile option ALPHAL (WORD), you can also specify NOALPHAL. Specify either of these options because the entry-name of a program to be used as an export function is case-sensitive. Also specify the compile option THREAD (MULTI) because ISAPI Applications should be multi-threaded applications.
Linking a COBOL object program (creating a DLL)
To link the object code created by compiling a COBOL source program, either execute the WINLINK command in the Project Manager to use the window operation or type a link command at the command prompt. This section provides an example of typing a link command to link a COBOL source program. For details about linkage using the WINLINK command or a link command, see the " NetCOBOL User's Guide."
In this explanation, the DLL to be created is ISASMPL.DLL. Before linking the program, prepare a module definition file as described later. In this explanation, this file is names ISASMPL.def, and contains the following statements:
LIBRARY ISASMPL EXPORTS GetExtensionVersion HttpExtensionProc TerminateExtension
Link the program as follows:
LINK /DLL /OUT:ISASMPL.DLL Version.obj MainProc.obj Terminate.obj
F3BICBDM.obj F3BISAPI.lib F3BICIMP.lib KERNEL32.LIB MSVCRT.LIB
/DEF:ISASMPL.def /ENTRY:COBDMAIN
If you link F3BICBDM.obj and specify /ENTRY:COBDMAIN, you can place an initialization file (COBOL85.CBR) in the same folder as the DLL, regardless of the current folder. Since the current folder is undefined for an application under a WWW Server such as IIS, being able to place an initialization file in the same folder as the DLL is very convenient. For details, see the " NetCOBOL User's Guide."
Note
ISAPI Subroutines are NOT downward compatible. This means that a library file with a version level newer than a subroutine to run (COBW3.cbl) cannot be used. Additionally, do not link an ISAPI subroutine with a version level older than a library file brought in by the Web application.