akaGM
Platinum Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору ! Delphi prototype ! Function wspSPT(const p: Double; const t: Double): Double; stdcall; external 'okawsp6.dll'; use kernel32 implicit none interface real*8 function wspSPT(p, t) !DEC$ ATTRIBUTES STDCALL, DLLIMPORT :: wspSPT !DEC$ ATTRIBUTES ALIAS : 'wspSPT' :: wspSPT !DEC$ ATTRIBUTES VALUE :: p !DEC$ ATTRIBUTES VALUE :: t real*8 p, t end function wspSPT end interface integer(handle) :: hdll integer(bool) :: unloadres pointer(pFunc, wspSPT) real*8 p, t, res hdll = LoadLibrary("OKAWSP6.DLL"C) ! perform some checks... if (hdll == NULL) then print *, 'error loading DLL' stop end if pFunc = GetProcAddress(hdll, "wspSPT"C) if (pFunc == NULL) then print *, 'error loading function wspSPT' stop end if ! using... p = 2500000.0d0 t = 410.1d0 res = wspSPT(p, t) print *, res print *, wspSPT(2500000.0d0,410.1d0) !/using unloadres = FreeLibrary(hdll) if (unloadres == 0) print *, 'error unloading DLL' end !main |