home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
nt1632.txt
< prev
next >
Wrap
Text File
|
1993-12-31
|
2KB
|
52 lines
Eureka! It works!
A MicroFocus COBOL program running in 16-BIT mode calling an IBM C SET++ program running in 32-BIT mode. It was a pure and excitement!!!!
NTCOB16.CBL
$set ans85 linklib(coblib+os2286)
identification division.
program-id. NTCOB16.
environment division.
special-names.
call-convention 3 is Pascal.
data division.
working-storage section.
77 the-number pic 9(4) comp-5 value 26.
77 the-message pic x(10) value "Before" & x'00'.
procedure division.
display the-number the-message.
call pascal "NTC32" using
by reference the-number
by reference the-message. .
display the-number the-message.
stop run.
NTC32.C
#include <stdio.h>
_Far16 _Pascal NTC32(short int * _Seg16 the_number, char * _Seg16 the_mess)
{
char * the_pointer32;
/* Going from 16:16(16-BIT) to 0:32(32-bit) for the-mess
because printf and stcpy would receive 16:16(16-BIT) address */
the_pointer32 = the_mess;
printf("Received parameters: %i, %s", *the_number, the_pointer32);
/* Change parameters to show it works well */
*the_number = 39;
strcpy(the_pointer32,"After");
}
NCT32.DEF
; DEF for DLL
LIBRARY INITINSTANCE
CODE LOADONCALL
EXPORTS NTC32 @1
Long live to 32-BIT!!!!