Re: MSPF/CVF/CVF DLL calling a LF90/LF95 DLL?
From: Richard Maine (nospam_at_see.signature)
Date: 12/18/03
- Next message: FCC: "g77 and DVF works fine but ifc causes a run-time error! Any ideas?"
- Previous message: G.F. Thomas: "Re: intel fotran 8 crashes studio"
- In reply to: Catherine Rees Lay: "Re: MSPF/CVF/CVF DLL calling a LF90/LF95 DLL?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Dec 2003 13:36:57 -0800
Catherine Rees Lay <spamtrap@polyhedron.org.uk> writes:
> Remember that a DLL doesn't know what called it. It just gets
> information, which it blithely assumes has been sent using the calling
> conventions etc. it understands. There's no such thing as a DLL which
> only works from C, or from Fortran, or whatever. If you can get it the
> right information in the right format, it will never know what
> language you are using. Conversely, send it using cdecl instead of
> stdcall and you won't get a nice friendly error message saying "excuse
> me, you're not using my calling convention", you'll get a crash or
> junk results.
which sounds an awful lot like "good" old f77-style external procedures.
Discrepancies between the caller and callee were among the most common
sources of errors in f77 codes and were occasionally very tricky to
debug. Some of the nastiest debugging experiences I've ever had were
related to this, with symptoms that didn't show up until far later in
far-removed parts of the program. This is still a pretty common source
of bugs in code that this newsgroup is asked for help with.
Those of us who put essentially all our procedures in modules don't
much have this problem any more. I don't recall the last time that
I had this class of error in my own Fortran code - it has been a
*LONG* time. (Though I "cheated" by adding the word Fortran in that
sentence, which allows me to exclude problems relating to interfacing
between Fortran and C codes; I've certainly had argument mismatch
problems there a lot more recently than I have had in any purely Fortran
parts of my codes).
Of course, we've recently been assured both that dlls solve all of the
world's problems and that f90 features like modules don't have
anything useful to offer. So I'm obviously pretty out of touch with
things. :-(
-- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
- Next message: FCC: "g77 and DVF works fine but ifc causes a run-time error! Any ideas?"
- Previous message: G.F. Thomas: "Re: intel fotran 8 crashes studio"
- In reply to: Catherine Rees Lay: "Re: MSPF/CVF/CVF DLL calling a LF90/LF95 DLL?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|