Calling 32-bit FORTRAN dlls from 32-bit VB
A lot of the following is Watcom-specific, so this might not be the
best place to post it. However, the traffic on Powersoft's Watcom
fortran forum has been VERY light so I thought that I'd post this here
I'm using Watcom FORTRAN 11b to create a 32-bit dll that I'm calling from
VB4-32. The FORTRAN application was originally an executable that read an
input file that I created in Visual Basic. In order to convert my exe to a
dll, I changed the main routine to a subroutine which I call from VB.
Initially, I hardcoded all of the data that I was reading from the input file,
but am now passing several key ones from VB and returning several arrays.
As I add arguments to the main subroutine in my dll, the pragma is
beginning to get very long. Here it is, I've broken it into two lines:
*$pragma aux (__stdcall) TMMAIN "TModel" export parm(reference, reference,
reference, value, value, value,value)
Is there any way to get a line continuation on a pragma? Is there any
limitation on it length? I'm compiling my code with the /xl option. Does
the pragma have the same line limits as the rest of my code? (132 characters,
from what I recall)
Also, I can't seem to pass an array of input data by value, only by reference.
What are the advantages and disadvantages of reference and value. I figured
that since passing variables by value meant that the dll couldn't modify
the value that was in the VB calling program, that this would be desirable
for inputs. My understanding is that passing variable by reference gives the
called program access to the chunk of memory that the caller program uses,
this would seem to reduce the ammount of memory required compared to passing
To respond via e-mail, please remove what's between Eric and Goforth in
my address in order to get my real e-mail address.