exporting functions/subs from fortran?

From: Jeff D. Hamann (jeff.hamann_at_forestinformatics.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 09:09:56 -0700

FORTRAN folks,

I apologies in advanced for asking a seemingly non-FORTRAN question here,
but this project is all FORTRAN and I figured this would be a good place to
ask.

I've been looking at extending a large FORTRAN project so that developers
can utilize functions and subroutines from outside the process (the exe).
I've created a test project (an exe) and exported a couple of functions and
have been successful in calling the exported subroutines from another
process like VBA in Access. When I attempt to assign a variables some value
in the source code (when debugging) I get access violations. I thought it
had something to do with the way I was calling the exported functions, so
simply commented out my code to see if the previously existing code would
work. Again, when the debugger got a line of code with an assignment op
(usually very early into a subroutine), I got an access violation. I created
a second project that didn't contain a "program main" and it worked fine
(created a genuine dll project). I'm assuming it has something to do with
the fact that I'm calling code in an exe from another exe and the first
process has "secured" the memory so that the second "process" (now loaded as
a DLL) cannot change values. Creating a DLL "version" isn't really
acceptable because most of the others in the project don't get the concept
and I want the changes to the code in the repos to be as minimal as
possible.

If that's the case, is it possible to call code in one exe from another
using the DLL framework? And if so, how?

Thanks,
Jeff.

---
Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon USA 97339-1421
541-754-1428
jeff.hamann@forestinformatics.com
www.forestinformatics.com


Relevant Pages

  • Re: exporting functions/subs from fortran?
    ... | but this project is all FORTRAN and I figured this would be a good place to ... For one, I knew it was possible to export functions from an .exe file, ... | in the source code I get access violations. ... | (created a genuine dll project). ...
    (comp.lang.fortran)
  • Re: exporting functions/subs from fortran?
    ... It's nice to hear other developers with your caliber exist. ... Yes I did dismiss the other options regarding the DLL development (in-proc, ... >> but this project is all FORTRAN and I figured this would be a good place ... >> the fact that I'm calling code in an exe from another exe and the first ...
    (comp.lang.fortran)
  • Re: Fortran-Dll von VB aus aufrufen
    ... > starte auf jedem PC der Visual Fortran installiert hat. ... Da die EXE einwandfrei unter den angegebenen ... wenn Visual Fortran auf dem jeweiligen Computer installiert ist. ... einfach einmal in VF alle Einstellungen zum Linken für die DLL überprüfen. ...
    (microsoft.public.de.vb)
  • Re: Editors
    ... some strip them on exe files by default. ... "preferred base address" and, yup, relocations are completely ... DLL files, though, aren't loaded into their own address space but are ... EXE's "entry-point", though, is not "special" in that it's just an ...
    (alt.lang.asm)
  • Re: Look at this before considering to use Intel Visual FORTRAN
    ... > FORTRAN is definitely not the first choice. ... > workaround by writing a COM-Wrapper in DVF, so the DLL runs in the DVF ... > Intel Customer Support ...
    (comp.lang.fortran)