Q: Callback from FORTRAN DLL

PLEASE HELP !!!

Can someone help me with this problem.
Please send answers or suggestions to my email-address:
P.B...@gamma.rug.nl

I have a Delphi program containing a function WriteOut, and
FORTRAN DLL written with WATCOM FORTRAN 77.

Delphi function:

function WriteOut(a:integer):integer: export;
begin
  MessageDlg('I write this integer: '+inttostr(a), mtInformation,[mbOK],1);
  { do other interface-stuff }
end;

The pascal program loads the DLL and calls a routine. In this routine I
want to do a callback to the WriteOut function.

The first problem is that de DLL needs to know the address of the WriteOut
function. The next problem is how to make the call to the function in
FORTRAN.

In the WATCOM Help I found a small piece of code, but that is not enough
for me to find the solution.

           integer*4 pCb, fpProc

           pCb = GetProc16( A_Function, GETPROC_callbacktype )
           fpProc = MakeProcInstance( pCb, hInstance )

     *     do stuff

           call Do_it( ..., fpProc, ... )

     *     do more stuff

           call FreeProcInstance( fpProc )
           call ReleaseProc16( pCb )

I hope that you can help me.

Peter Boer
iec ProGAMMA