- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
!---------------
MODULE DLL_Interface
USE Kernel32
IMPLICIT NONE
! Defined TYPEs:
TYPE DLL_Type
INTEGER(4) :: FileAddr
INTEGER(4) :: ProcAddr
CHARACTER(1024) :: FileName
CHARACTER(1024) :: ProcName
END TYPE DLL_Type
CONTAINS
=======================================================================
SUBROUTINE LoadDLL ( DLL )
USE NWTC_LIBRARY, ONLY: ProgAbort
IMPLICIT NONE
! Passed Variables:
TYPE (DLL_Type), POINTER :: DLL ! The DLL to be loaded.
! Load the DLL and get the file address:
DLL%FileAddr = LoadLibrary( TRIM(DLL%FileName)//CHAR(0) )
IF ( DLL%FileAddr == 0 ) CALL ProgAbort ( ' The DLL '//TRIM(DLL%FileName)//' could not be loaded.' )
! Get the procedure address:
DLL%ProcAddr = GetProcAddress( DLL%FileAddr, TRIM(DLL%ProcName)//CHAR(0) )
IF ( DLL%ProcAddr == 0 ) CALL ProgAbort ( ' The procedure '//TRIM(DLL%ProcName)//' could not be loaded.' )
RETURN
END SUBROUTINE LoadDLL
I get the following error:
C:\\\\\\FAST\\\\Source\\\\BladedDLLInterface.f90(119): error #6284:
There is no matching specific function for this generic function reference. [GETPROCADDRESS]
DLL%ProcAddr = GetProcAddress( DLL%FileAddr, TRIM(DLL%ProcName)//CHAR(0) )
I am a bit confused because GetProcAddress is in kernel32 along with LoadLibrary, and this code previously compiled using v10 for 32-bit. I expect I am missing something?
Andy Elliott
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Note also that when you return a value from LoadLibrary, that is a 64-bit value but you assign it to a 32-bit value, which will cause run-time errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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