module link_cont
interface
subroutine I_FileOpenCont (ncase,ndata,lpool,xfiles)
integer(kind=) :: ncase
integer(kind=) :: ndata
integer(kind=) :: lpool
character(len=), dimension() :: xfiles
endsubroutine I_FileOpenCont
endinterface
endmodule link_cont program s
use link_cont
use Kernel32
use , intrinsic :: ISO_C_Binding !// 标准模块
implicit none
type(C_FUNPTR) :: C_FileOpenCont !// C 语言指向函数的指针
procedure(I_FileOpenCont) , pointer :: FileOpenCont !// fortran 指向函数的指针
!<-------------------------------------------------------------------------------------------------------------------------------
integer(kind=) :: add
integer(kind=) :: hwnd
integer(kind=) :: n_case
integer(kind=) :: n_data
integer(kind=) :: lpool
character(len=), dimension() :: c_files
logical :: fail
logical :: syslink
!<-------------------------------------------------------------------------------------------------------------------------------
hwnd = LoadLibrary('control.dll'//c_null_char)
if (hwnd <= ) then
fail = .true.
syslink = .false.
write(*,*) 'DLL Loading failure because control.dll was not found'
read(*,*)
else
write(*,*) 'Succeed Contempt DLL (control.dll) Loading'
add = GetProcAddress(hWnd,'FILEOPENCONT'//c_null_char) !//获得地址(整数)
C_FileOpenCont = transfer( add , C_FileOpenCont ) !//把整数的地址转换成 C 指针
call C_F_PROCPOINTER( C_FileOpenCont , FileOpenCont ) !//把C指针转换成 fortran 指针
call FileOpenCont(n_case,n_data,lpool,c_files)
syslink=FreeLibrary(hwnd)
endif
end program s

在delphi和intel fortran下实证过。

Intel Fortran 调用Delphi编制的DLL的更多相关文章

  1. nodejs调用delphi编写的dll

    公司的业务需要,nodejs要读取文件版本号. 同事要求我用delphi编写dll,以供nodejs调用,结果通过json返回. delphi代码如下: function GetFileInfo(AP ...

  2. [JNA系列]Java调用Delphi编写的Dll之实例Delphi使用PWideChar

    Delphi代码 unit UnitDll; interface uses StrUtils, SysUtils, Dialogs; function DoBusinessWide(pvData: P ...

  3. [JNA系列]Java调用Delphi编写的Dll之实例Delphi使用PAnsiChar

    Delphi代码 unit UnitDll; interface uses StrUtils, SysUtils, Dialogs; function DoBusinessAnsi(pvData: P ...

  4. [JNA系列]Java调用Delphi编写的Dll之JNA使用

    介绍 给大家介绍一个最新的访问本机代码的 Java 框架 —JNA . JNA(Java Native Access) 框架是一个开源的 Java 框架,是 SUN 公司主导开发的,建立在经典的 JN ...

  5. Go调用Delphi编写的DLL

    参数整数没有问题,但是如果是字符串,要注意几个细节. 记录如下: 1.Delphi定义函数的时候,字符串参数需要使用PChar类型 2.Go传递参数的时候要将字符串转成UTF16的指针,接收的时候采用 ...

  6. C# 调用delphi编写的dll

    技术实现 如何逐步实现动态库的加载,类型的匹配,动态链接库函数导出的定义,参考下面宏定义即可: #define LIBEXPORT_API extern "C" __declspe ...

  7. [JNA系列]Java调用Delphi编写的Dll之Delphi与JAVA基本数据类型对比

    Delphi与JAVA基本数据类型对比 类型 Delphi关键字 JAVA关键字 字节 备注 范围 整型 Shortint byte 1 有符号8位 -128..127 Byte 1 无符号8位 0 ...

  8. 深入Delphi下的DLL编程

    深入Delphi下的DLL编程 作者:岑心 引 言 相信有些计算机知识的朋友都应该听说过“DLL”.尤其是那些使用过windows操作系统的人,都应该有过多次重装系统的“悲惨”经历——无论再怎样小心, ...

  9. 在.net中调用Delphi dll的Pchar转换

    Pchar是非托管代码,要在.net中调用Delphi dll中的功能,请使用MarshalAs属性告知.net调用PInvoke去转换.net中标准的string类型.如果Delphi dll是De ...

随机推荐

  1. continue — Skip to the next iteration of a loop in a shell script

    continue — Skip to the next iteration of a loop in a shell script

  2. SpringBoot集成阿里巴巴Druid监控

    druid是阿里巴巴开源的数据库连接池,提供了优秀的对数据库操作的监控功能,本文要讲解一下springboot项目怎么集成druid. 本文在基于jpa的项目下开发,首先在pom文件中额外加入drui ...

  3. 动画库NineOldAndroids

    动画库NineOldAndroids   NineOldAndroids组件是一个向下兼容的动画库,主要是使低于API 11的系统也能够使用View的属性动画.该动画库支持旋转.移动.透明渐变.缩放等 ...

  4. 深度学习目标检测:RCNN,Fast,Faster,YOLO,SSD比较

    转载出处:http://blog.csdn.net/ikerpeng/article/details/54316814 知乎的图可以放大,更清晰,链接:https://www.zhihu.com/qu ...

  5. VMware5.5-vCenter Converter(转换)

    vCenter Converter 已知问题 出现:指定的参数不正确: "info.owner" 操作时一定是管理员,而不是管理员组的成员.或者: 如果 Converter Sta ...

  6. JS简单实现滚动自动加载新内容(懒加载)

    加载源 // 这里存后台发来的数据 var galleryList = [ { src: "./images/1.jpeg", desc: "11111" }, ...

  7. Safari 中加载 Flash 使用overflow失效的bug

    在Flash标签中加入参数:wmode=transparent

  8. mysql命令(command)

    连接mysql命令: -uuserName -pPassword 显示表的索引: SHOW INDDEX FROM table_name 查看mysql的超时时间:SHOW GLOBAL VARIAB ...

  9. 在Windows 操作系统中, MySql 如何设置, 允许表名支持大小写

    一般在网上会说明 修改my.ini文件的  lower_case_table_names = 0 参照: http://www.linuxidc.com/Linux/2013-04/82719.htm ...

  10. AIX使用命令修改网卡IP地址,永久生效

    比如修改en0的ip地址.chdev -l en0 -a netaddr=192.168.1.100 -a netmask=255.255.255.0 -a state=up 启用en0 网卡ifco ...