Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Fujistu has some samples included.
In order to call a DLL you do link with the LIB, not the DLL. LIB's is the way compilers know what the DLL contains.
As for procedure points. do you have an example of what you are trying to do? i may install my old v3 just to see.
program pp; uses empty_unit;
var
c: procedure;
procedure a;
begin
writeln('Procedure A has run');
end;
begin
c := @a; { set procedure pointer to the address of the static procedure}
c; { execute the procedure pointer }
end.
000010 @OPTIONS NOMAIN
000020 IDENTIFICATION DIVISION.
000030 PROGRAM-ID. COBDLLTST.
000040 ENVIRONMENT DIVISION.
000050 INPUT-OUTPUT SECTION.
000060* DLL TEST ATTEMPT, ADD 2 NUMBERS, RETURN RESULT
000070 DATA DIVISION.
000080 LINKAGE SECTION.
000090 01 NUMBER1 PIC S9(9) COMP-5.
000100 01 NUMBER2 PIC S9(9) COMP-5.
000110 01 NUMBER3 PIC S9(9) COMP-5.
000120 PROCEDURE DIVISION WITH STDCALL LINKAGE USING NUMBER1 NUMBER2 NUMBER3.
000160 0000-MAIN SECTION.
000170 ADD NUMBER1 TO NUMBER2 GIVING NUMBER3.
000180 EXIT PROGRAM.
000010 @OPTIONS MAIN,NOALPHA
000020 IDENTIFICATION DIVISION.
000030 PROGRAM-ID. COBDLLMAIN.
000040* COMPILER. FUJITSU COBOL 3.0.
000050 ENVIRONMENT DIVISION.
000060 INPUT-OUTPUT SECTION.
000070* DLL TEST ATTEMPT, ADD 2 NUMBERS, RETURN RESULT
000080 DATA DIVISION.
000090 WORKING-STORAGE SECTION.
000100 01 DLL-CALL-DATA.
000110 04 DLL-NAME.
000120 08 PIC X(13) VALUE "COBDLLTST.DLL".
000130 08 PIC X VALUE X'00'.
000140 04 DLL-PROC-NAME.
000150 08 PIC X(09) VALUE "COBDLLTST".
000160 08 PIC X VALUE X'00'.
000170 04 DLL-HANDLE PIC S9(9) COMP-5.
000180 04 DLL-UNLOAD PIC S9(9) COMP-5.
000190 04 DLL-PROC-NUM PIC S9(9) COMP-5.
000200 04 DLL-PROC-ADDR REDEFINES DLL-PROC-NUM POINTER.
000210 04 DLL-LAST-ERROR PIC S9(9) COMP-5.
000220 01 NUMBER1 PIC S9(9) COMP-5.
000230 01 NUMBER2 PIC S9(9) COMP-5.
000240 01 NUMBER3 PIC S9(9) COMP-5.
000250 PROCEDURE DIVISION.
000260 0000-MAIN SECTION.
000270 DISPLAY "ENTER FIRST NUMBER: ".
000280 ACCEPT NUMBER1.
000290 DISPLAY "ENTER SECOND NUMBER: ".
000300 ACCEPT NUMBER2.
000310*************************************************************
000320* LOAD THE DLL
000330*************************************************************
000340 DISPLAY "LOADING TEST DLL..." DLL-NAME.
000350 CALL "LoadLibraryA" WITH STDCALL LINKAGE
000360 USING
000370 BY REFERENCE DLL-NAME
000380 END-CALL.
000390 MOVE PROGRAM-STATUS TO DLL-HANDLE.
000400 IF DLL-HANDLE = 0
000410 DISPLAY "ERROR IN LOAD : " DLL-NAME
000420 PERFORM 1000-LASTERROR
000430 END-IF.
000440*************************************************************
000450* GET TEST PROCEDURE ADDRESS
000460*************************************************************
000470 DISPLAY "GETTING TEST PROCEDURE..." DLL-PROC-NAME
000480 CALL "GetProcAddress" WITH STDCALL LINKAGE
000490 USING
000500 BY VALUE DLL-HANDLE
000510 BY REFERENCE DLL-PROC-NAME
000520 END-CALL.
000530 MOVE PROGRAM-STATUS TO DLL-PROC-NUM.
000540 IF DLL-PROC-ADDR = NULL
000550 DISPLAY "ERROR IN PROC LOAD : " DLL-PROC-NAME
000560 PERFORM 1000-LASTERROR
000570 END-IF.
000580*************************************************************
000590* NOW USE THE DLL PROCEDURE
000600*************************************************************
000610****!FOR DLL CALL TO WORK, WE MUST BE ABLE TO CALL A PROCEDURE
000620****!AS LISTED BELOW THIS COMMENT.
000630* CALL DLL-PROC-ADDR WITH STDCALL LINKAGE
000640* USING
000650* BY REFERENCE NUMBER1
000660* BY REFERENCE NUMBER2
000670* BY REFERENCE NUMBER3
000680* END-CALL.
000690 DISPLAY "NUMBER3 = " NUMBER3.
000700*************************************************************
000710* FREE THE DLL
000720*************************************************************
000730 DISPLAY "FREEING TEST DLL..." DLL-NAME.
000740 CALL "FreeLibrary" WITH STDCALL LINKAGE
000750 USING
000760 BY VALUE DLL-HANDLE
000770 END-CALL.
000780 MOVE PROGRAM-STATUS TO DLL-UNLOAD.
000790 IF DLL-UNLOAD = 0
000800 DISPLAY "ERROR IN DLL UNLOAD : " DLL-NAME
000810 PERFORM 1000-LASTERROR
000820 END-IF.
000830*************************************************************
000840 GOBACK.
000850
000860 1000-LASTERROR SECTION.
000870 CALL "GetLastError" WITH STDCALL LINKAGE
000880 END-CALL.
000890 MOVE PROGRAM-STATUS TO DLL-LAST-ERROR.
000900 DISPLAY "EXTENDED ERROR CODE = " DLL-LAST-ERROR.
000910 GOBACK.
[COBDLL2]
@IconName=COB85EXE
@ScrnSize=(80,24)
@CnslWinSize=(80,24)
@CnslBufLine=100
@WinCloseMsg=ON
@EnvSetWindow=USE
@AllFileExclusive=NO
@CBR_PrintTextPosition=TYPE1
@CBR_TextAlign=BOTTOM
[COBDLL2.ENTRY]
COBDLLTST=COBDLLTST.DLL
000010 @OPTIONS MAIN,DLOAD,NOALPHAL
000020 IDENTIFICATION DIVISION.
000030 PROGRAM-ID. COBDLL2.
000040* COMPILER. FUJITSU COBOL 3.0.
000050 ENVIRONMENT DIVISION.
000060 INPUT-OUTPUT SECTION.
000070* DLL TEST ATTEMPT, ADD 2 NUMBERS, RETURN RESULT
000080 DATA DIVISION.
000090 WORKING-STORAGE SECTION.
000100 01 NUMBER1 PIC S9(9) COMP-5.
000110 01 NUMBER2 PIC S9(9) COMP-5.
000120 01 NUMBER3 PIC S9(9) COMP-5.
000130 PROCEDURE DIVISION.
000140 0000-MAIN SECTION.
000150 DISPLAY "ENTER FIRST NUMBER: ".
000160 ACCEPT NUMBER1.
000170 DISPLAY "ENTER SECOND NUMBER: ".
000180 ACCEPT NUMBER2.
000190 CALL "COBDLLTST" USING NUMBER1, NUMBER2, NUMBER3.
000200 DISPLAY "NUMBER3 = " NUMBER3.
000210 STOP RUN.
why not use COM ?
Why not try ... then the cobol85.cbr entries would not be needed unless you are doing some other file associations.
JMP0015I-U CANNOT CALL PROGRAM 'open_file'. CODE=0x7E PGM=WORDCNT3C ADR=004016B2