- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hello,
I have a FORTRAN program that needs to load DLL's on the fly (the name of the DLL isn't even know until an input file is read). You have been kind enough to include an interface for the LoadLibrary function in the Kernel32.f90 file that ships with Visual Fortan. However, this file does not have an interface for the C function SetDllDirectory, at least not in version 10.1.21.
[FYI:SetDllDirectory allows you to register a directory as part of the DLL search algorithm [link]. This is particularly important if you want to set a DLL search path without having to modify the %PATH% variable]
The C declaration is:
BOOL WINAPI SetDllDirectory(
__in_opt LPCTSTR lpPathName
);
Below is my attempt at a FORTRAN interface for SetDllDirectory. I modified the LoadLibrary Interface as I did not understand all of the !DEC calls. Some lines I had to comment out!
It seemed to compile fine, but i get a linker error:
error LNK2001: unresolved external symbol _SETDLLDIRECTORY@8
I know thatkernel32.lib is being liked fine b/c the LoadLibrary function links fine. Can anyone see what I am doing wrong here? My FORTRAN isn't strong to begin with and when it comes to FORTRAN calling C I am very lost...
Any suggestions? Or better yet, a version of IVF that has the interface already in place?
Thanks!
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Note there is two typos in the commented!DEC$ line - SetDllDircetory should be SetDllDirectory (unless of course that is truly the name of the function).
Regards,
Arjen
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
You should have left the !DEC$ ATTRIBUTES line in there. It looks correct to me.
I don't think we've added that call - I'll check tomorrow. We have a lot of catching up to do in this regard.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Note there is two typos in the commented!DEC$ line - SetDllDircetory should be SetDllDirectory (unless of course that is truly the name of the function).
Regards,
Arjen
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
you are correct sir! sorry, after staring at it for so long, i missed the obvious spelling error. Made the correction and everything seems to link up fine!
Thank you both for your input and hopefully this will make it into IVF in a future release.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Oddly enough I have not been able to find this function in the C header files for the MSVC compiler (I tried several versions).
Regards,
Arjen
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite