This is useful if the DLL may not exist, or may be a different version to the developer's, or may not have the module, ....
C Do this once to get the entry point
Subroutine GetDLLEntryPoint (YourEntryPoint)
stdcall external LoadLibraryA, GetProcAddress
integer*4 LoadLibraryA, GetProcAddress
integer*4 pl, pm, plvalue, YourEntryPoint
character*100 LibraryName, ModuleName
YourEntryPoint=0
LibraryName = "KERNEL32.DLL"//char(0)
ModuleName = "SetFilePointerEx"//char(0)
pl = loc(YourLibraryName)
plvalue = LoadLibraryA (val(pl))
if (plvalue.ne.0) then
pm = loc(YourModuleName)
YourEntryPoint = GetProcAddress (val(plvalue), val(pm))
endif
end
C Do this each time you need to access the module in the DLL
if (YourEntryPoint.ne.0) then
call YourDLLModule (val(YourEntryPoint),val(your parameter 1), val(),...)
endif
C This does the DLL module access
SUBROUTINE YourDLLModule (YourEntryPoint, your parameter 1, ...)
STDCALL EXTERNAL YourEntryPoint
integer*4 iostat, your parameter 1, ....
iostat = YourEntryPoint (val(your parameter 1), ....)
end