COBOL calling C calling COBOL 
Author Message
 COBOL calling C calling COBOL

I am trying to use a function within a C library that requires the
addresses of two functions/procedures that are within the COBOL code.
The function in the C library will "callback" the COBOL
functions/procedures with parameters.  Can this be done?  If so, how?

Thanks in advance for any help!!!!

Mark Erickson



Sat, 28 Aug 1999 03:00:00 GMT  
 COBOL calling C calling COBOL

Quote:

> I am trying to use a function within a C library that requires the
> addresses of two functions/procedures that are within the COBOL code.
> The function in the C library will "callback" the COBOL
> functions/procedures with parameters.  Can this be done?  If so, how?

If you are using MicroFocus COBOL, you can use a procedure pointer.  It is
described in the manual.

Del.



Tue, 31 Aug 1999 03:00:00 GMT  
 COBOL calling C calling COBOL

Quote:


> > I am trying to use a function within a C library that requires the
> > addresses of two functions/procedures that are within the COBOL code.
> > The function in the C library will "callback" the COBOL
> > functions/procedures with parameters.  Can this be done?  If so, how?

> If you are using MicroFocus COBOL, you can use a procedure pointer.  It is
> described in the manual.

> Del.

To point you in the right direction...
(Please check MSDEV Help for actual parameters.. I just write this as I
remembered it..)

int main(int argc, char *argv[]..)
{
  ....
  HINSTANCE HCobDLL;
  FARPROC CobENTRY;
  int parm1;
  char parm2[30];
  ....
  HCobDLL = LoadLibrary("MyCobFuncs.dll");
  CobENTRY = GetProcAddress(HCobDLL, "some_entry_point_of_mine");
  cobENTRY(parm1, parm2,...)
  ....

  exit(0);

Quote:
}

Something like the above (with som error-checking.. :-)) )..

I can get an actual working example if you don't get it to work...

Please note that you have to use CASE and LITLINK and MAP for your COBOL
DLL to make this work..

--
- Geir Knaplund



Wed, 01 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. COBOL calling C calling COBOL

2. tso rexx calls cobol calls cobol -> splat

3. Eztrieve calling a COBOL call module?

4. AS/400 Cobol trying to call an ILE Cobol function in a service progam - Please help

5. Calling a non-COBOL program from a COBOL program on OS/390

6. Calling Cobol from C (Microfocus Cobol)

7. Visual Age cobol calling Micro Focus cobol

8. COBOL II calls to OS/VS COBOL programs in batch

9. To See Whats Happen - Cobol Call Statistik

10. Trace Cobol/MVS (LE/MVS) dynamic CALL

11. Call HLASM program from COBOL MVS program

12. ASM call to Cobol subprogram

 

 
Powered by phpBB® Forum Software