- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've got a Fortran DLL application and at one point in it I'd like to load all the DLLs that I find in a given directory. However, I don't know how many DLLs there might be or what their names are. Is a combination of FindFirstFile, FindNextFile and LoadLibrary my best bet and if so, is there an example that sonmeone could lead me to? I am already using LoadLibrary successfully (thanks to your previous responses). If those commands aren't the best way to do it, I would be pleased to hear any other suggestions.
Thanks in advance,
David
Thanks in advance,
David
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's a piece of code from an actual app which copies all *.dat files from sBazaDir to sRadniDir folder and removes read-only attribute (it is used when the app detects that its working files are placed on a read-only medium like CD):
To me, it looks like you could apply it to your problem -- just use LoadLibrary instead of CopyFile. What do you want to obtain, actually?
Search for a library that contains a certain function?
Just a note which may be useful: you could also apply FindFirstFile to recursively traverse through subdirectories. If you apply GetFileAttributes
on WFD%cFileName and the result contains FILE_ATTRIBUTE_DIRECTORY flag, you can recursively apply the same operation on such WFD%cFileName.
Regards,
Jugoslav
TYPE(T_WIN32_FIND_DATA):: WFD INTEGER:: hFile LOGICAL:: bSt ... hFile=FindFirstFile(TRIM(sBazaDir)//"*.dat"C, WFD) DO WHILE (.TRUE.) iSt=CopyFile(WFD%cFileName, TRIM(sRadniDir)//""//WFD%cFileName, .FALSE.) iSt=SetFileAttributes(TRIM(sRadniDir)//""//WFD%cFileName, FILE_ATTRIBUTE_NORMAL) bSt=FindNextFile(hFile ,WFD) IF (.NOT.bSt) EXIT END DO
To me, it looks like you could apply it to your problem -- just use LoadLibrary instead of CopyFile. What do you want to obtain, actually?
Search for a library that contains a certain function?
Just a note which may be useful: you could also apply FindFirstFile to recursively traverse through subdirectories. If you apply GetFileAttributes
on WFD%cFileName and the result contains FILE_ATTRIBUTE_DIRECTORY flag, you can recursively apply the same operation on such WFD%cFileName.
Regards,
Jugoslav

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