- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I use the Windows function getprocaddress in a FORTRAN test program when calling a FORTRAN dll. The reason for using getprocaddress is that the test program must have 0 beforehand knowledge about the dll, i.e., no DLLIMPORT, no linked in lib-file etc.
When using IFORT 2021.7 getprocaddress returns proper addresses and the test program runs as expected. When I change to IFX 2026.0 getprocaddress returns 0.
Same happens if the dll is built using IFORT and the test program is built using IFX. Dynamic or static linking of the runtime libraries give the same behavior.
Is there an issue between IFX 2026.0 and getprocaddress or am I doing something wrong? Small test solution attached. I hope someone can reproduce it. My Windows 11 Pro is updated and has version 10.0.26200. If anyone can suggest a functioning alternative to getprocaddress given the restrictions set out above that would also be great.
vh,
Henrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just looked at the intel interfaces in kernel32.f90 and I would expect that "SUB1" will need to be NULL terminated otherwise it may or may not work dependant on what comes next in memory. You also need to match the case of the function in the DLL I did not try to check that out but a dumpbin on the dll will give the exact names used.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just looked at the intel interfaces in kernel32.f90 and I would expect that "SUB1" will need to be NULL terminated otherwise it may or may not work dependant on what comes next in memory. You also need to match the case of the function in the DLL I did not try to check that out but a dumpbin on the dll will give the exact names used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to you and @Steve_Lionel. Appending the null character did the trick. It runs now. I had never figured that out myself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort "helpfully" added a NUL character at the end of character literals - as @andrew_4619 says, the API wants a NUL-terminated string. ifx doesn't do this (and it really shouldn't.) Indeed, case is also important.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page