- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have in my Fortran code:
dll_handle = LoadLibrary('Test123.dll'//char(0))
However this Fortran code may also be called from a C++ wrapper which may have already dynamically loaded this DLL. From a quick test the Fortran call does not simply return the handle that the C++ wrapper got when it loaded it, but returns a different handle. Has the DLL been loaded twice? If so is this a problem?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apologies it does seem to use the same handle. I was looking at what the C++ variable was pointing to rather than the variable itself which is of HMODULE type which apparently is a pointer of type pvoid (defined as typedef void *PVOID;)
I guess the Fortran variable dll_handle, declared as integer, is also one of these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure the Fortran variable is declared integer(HANDLE), not just integer.

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