Re: FORTRAN DLLs in VB 2005



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
http://softwareforums.intel.com/ISN/Community/en-US/forums/thread/30221874.aspx
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
http://softwareforums.intel.com/ISN/Community/en-US/forums/thread/116155.aspx

Steve

.