- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a previous post (2003) it is stated that you cannot DLLExport a generic function and that you have to export each individual routine, i.e. in the code belowyou cannotexport M_TO_STRING, only M_INT_TO_STRING etc.? Does anyone know if this situation has changed or will change in the near future?
Thanks
Ranbir
INTERFACE M_TO_STRING
MODULE PROCEDURE M_INT_TO_STRING MODULE PROCEDURE M_REAL_TO_STRING MODULE PROCEDURE M_LOGICAL_TO_STRING END INTERFACE M_TO_STRINGLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is not going to change. There is not a real function M_TO_STRING to export. For Fortran code, you don't need to export M_TO_STRING - any Fortran code that uses the module will determine which of the specific procedures to call and will use its specific name - which then needs to have been DLLEXPORTed.
If you're calling this from some other language, how do you expect it to figure out which signature to use?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I see how you're supposed to do it now. As a follow on, I'm also having trouble exporting a routine which expects a passed length characteras an argument. For example the code below produces an error during compilation. Does this mean you can only have fixed length characters as arguments for exported functions?
INTEGER FUNCTION M_LATLONG_FROM_STRING (K_LATLONG, J_LAT, J_LONG) & RESULT ( J_ERR ) !DEC$ATTRIBUTES STDCALL, DLLEXPORT :: M_LATLONG_FROM_STRING !DEC$ATTRIBUTES ALIAS : "M_LATLONG_FROM_STRING" :: M_LATLONG_FROM_STRING !DEC$ATTRIBUTES REFERENCE :: K_LATLONG !DEC$ATTRIBUTES REFERENCE :: J_LAT !DEC$ATTRIBUTES REFERENCE :: J_LONG CHARACTER(LEN=*), INTENT (IN) :: K_LATLONG INTEGER, INTENT (OUT):: J_LAT INTEGER, INTENT (OUT):: J_LONG- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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