Top
NetCOBOL V11.0 ISAPI Subroutines User's Guide
FUJITSU Software

3.2.2 Calling ISAPI Subroutines

It is necessary to call first "COBW3_INIT" to set the ISAPI Subroutine environment and to acquire Web parameters. When terminating ISAPI Subroutine processing (at the end of the procedure), be sure to call "COBW3_FREE" to release resources allocated by ISAPI Subroutines.

Call other subroutines using the CALL statement as needed.

When calling other subroutines in a program different from the program that called "COBW3_INIT", pass the interface area (COBW3) defined by the program that called "COBW3_INIT" to other programs that need to make ISAPI Subroutine calls and call other subroutines using the same area.

Example

When "COBW3_INIT" is called by the parent program and "COBW3_FREE" is called by the child program B.

Parent program:

IDENTIFICATION  DIVISION.
PROGRAM-ID.     "HttpExtensionProc".
DATA            DIVISION.
WORKING-STORAGE SECTION.
  COPY COBW3.
LINKAGE       SECTION.
  COPY ISAPICTX.
PROCEDURE DIVISION WITH STDCALL LINKAGE USING ISAPI-CTX-CNT.
   MOVE LOW-VALUE TO COBW3.
   MOVE FUNCTION ADDR(ISAPI-CTX-CNT) TO COBW3-CONTEXT.
   CALL "COBW3_INIT" USING COBW3.
        :
   CALL "B"          USING COBW3.
*
    MOVE 1 TO PROGRAM-STATUS.
    EXIT PROGRAM.

Child program:

IDENTIFICATION  DIVISION.
PROGRAM-ID.     B.
DATA            DIVISION.
LINKAGE         SECTION.
    COPY COBW3.
PROCEDURE       DIVISION USING COBW3.
          :
    CALL "COBW3_FREE" USING COBW3.
    EXIT PROGRAM.