- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are converting a core DLL to use REAL(8) precision and would like to make the routine generic so that calling programs only require a "USE ..." rather than changing a lot of REAL(4)'s to REAL(8)'s. The general idea is that the interface defines the generic subroutine name used in higher level program components and the implementations have a structure like:
CONTAINS
Subroutine A_Single(DBLE(X),DBLE(Y),DBLE(Z))
...
Subroutine A_Double(X, Y, Z)
The only thing we have not done is determine the best way to package the generic function inside of the DLL. This is similar to the way Fortran generics are used but I'd like a pointer to an example of how it's done. Probably have one on the CVF 6.6 disk, but I haven't found it yet.
Thanks for all the help
John
CONTAINS
Subroutine A_Single(DBLE(X),DBLE(Y),DBLE(Z))
...
Subroutine A_Double(X, Y, Z)
The only thing we have not done is determine the best way to package the generic function inside of the DLL. This is similar to the way Fortran generics are used but I'd like a pointer to an example of how it's done. Probably have one on the CVF 6.6 disk, but I haven't found it yet.
Thanks for all the help
John
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There should be nothing special about DLLs -- just don't forget to distribute .mod file that comes from compiling the module along with .dll and .lib. Mod file should be handled similarly as an INCLUDE file. AFAIK DLLIMPORT directives are not required, so that shouldn't be an issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I found out that the generic module approach didn't really solve our problem. I had not thought it out fully and only later realized that C++, VB, and Delphi couldn't take advantage of the .mod file info so we will probably have to package the DLL with two modules; one for REAL(4) arguments and another for REAL(8) ones.
I've posted a better defined question related to this problem under the heading "common interface for mixed languages".
Thanks for the help
I've posted a better defined question related to this problem under the heading "common interface for mixed languages".
Thanks for the help

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page