Re: FORTRAN DLLs in VB 2005

Steve Lionel wrote:
etcheverryj@xxxxxxxxx wrote:
Ok so here's my problem. I'm creating a program to size parts in a
centrifugal compressor, and the majority of the program is coming from
an existing FORTRAN program. I'm actually an engineer who's beend told
to learn to program, and I'm trying to figure out how to use the
FORTRAN code as a dll to be used with visual basic code. I've been
practicing with very simple code and I'm running into an error that I
have not been able to fix.

You're going to have to step back a bit and realize that Fortran
doesn't understand VB strings (or objects) and VB has no clue what to
do with the character result of a Fortran function.

For a worked example of VB calling Fortran passing strings, see
While this was done in Intel Visual Fortran, the concepts should be
similar with other Windows Fortran compilers. This example doesn't
pass a string back, though. For a more complex example that reads and
writes VB's BSTR structures, see the MixedLanguage/VB.NET-Safearrays
sample at


Steve, I've been working on this sort of thing for the past few weeks,
and I've been still have trouble. I eventually tried just copying and
pasting the code and just changing the path name to the dll and I'm
getting an accessviolation exception. I've completely run out of
ideas, is there anything else you can suggest?