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
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

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?

.



Relevant Pages

  • Re: generic Fortran top level object type?
    ... | Steve Lionel wrote: ... || there is in Intel Fortran 8.0. ... subroutine SwapBytes ... end interface ...
    (comp.lang.fortran)
  • Re: %LOC and %VAL availability
    ... In article, Steve Lionel ... It would be nice if there were a Fortran compiler for VMS which supports ... the gold standard. ...
    (comp.lang.fortran)
  • Re: Tokyo meeting
    ... Steve Lionel wrote: ... Intel Fortran Support ... Support the Original G95 Project: http://www.g95.org ...
    (comp.lang.fortran)
  • Re: How popular is Fortran and what is its future ?
    ... written by Steve Lionel of Intel: ... fifty-year-old language considered long-dead by many, ... once programmed in Fortran. ...
    (comp.lang.fortran)
  • Re: FORTRAN DLLs in VB 2005
    ... and the majority of the program is coming from ... FORTRAN code as a dll to be used with visual basic code. ... For a worked example of VB calling Fortran passing strings, ...
    (comp.lang.fortran)