- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I locate a Fortran dll from within that specific binary file at run time? Is this supported? In VB6 one could use "stringx = app.path" & likewise in C# something along the lines of "stringx = Application.Path". Is there something close in Fortran?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you know the name (but not path) of the DLL, you can use GetModuleHandle(filename) to get a handle for the DLL and then call GetModuleFileName to get the path. These are Win32 API routines callable from Fortran.
If you want the executable path, pass NULL to GetModuleHandle.
If you want the executable path, pass NULL to GetModuleHandle.

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