- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I've been tasked with coming up with a way to expose some Fortran subroutines in a dll to both other Fortran projects and COM.
First of all: I do not know Fortran. You may wonder about the wisdom of choosing me to accomplish this task - I know I do ;) It is what it is!
I've spent considerable time researching this and I think it's time to ask for some direct help. Thesubroutines are:
sub1(real8a, real8b, char256c, char80d)
sub2 has 19 real(8) parameters
sub3 has 22 real(8) parameters
Here's what I've tried so far:
Put DLLExport statements in the dllto expose the subroutines, and DLLIMPORT statements in the project.
Created a generic console app that calls into the dll, using the .lib file. Result: Unresolved external.
I've used the /gen-interfaces switch to get a whole mess o' .mod and f90 files. I've linked to those individual mod files. Result: corrupt file or can't open file.
It would seem that I just don't get what needs to be done. It seems so simple...
I'm sure that I've left out crucial bits of information - I'm sorry, I just don't know what to provide. I'm happy to add anything that you need!
Thanks in advance,
Mike
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My most recent experience in this was calling Fortran from Excel VBA, where there is a function for filling a string with multiple characters. Don't know what language your COM routine is in, so can't advise you on that.
For the Fortran call, you should not need to fill the string before the call, but if you did, you could use a FORALL statement or DO Loop.
Regards, David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, it's the Fortran stuff we're having the issue with. It seems to already be padded.
Thanks,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are the strings declared as fixed length and 256 chars long on both sides of the call? Variable length strings seem to cause the most problems.
Can you get the DLL to work with a direct call from Fortran?
If you want me to look at your code (or a demo version of it), can you email it to roonwhit
Regards, David White

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »