主题:VB调用Fortran动态链接库时遇到的问题
我在VB调用Fortran动态链接库时遇到的问题
fortran动态连接库代码为:
Subroutine Fortrandll(r,s,l)
!DEC$ ATTRIBUTES DLLEXPORT:: Fortrandll
!DEC$ ATTRIBUTES ALIAS: 'Fortrandll' :: Fortrandll
real,INTENT(IN)::r
real,INTENT(OUT)::s,l
real:: pi
parameter(pi=3.1415926)
s=r*r*pi
l=2*pi*r
end Subroutine
VB界面、按钮及调用代码为:
Option Explicit
Dim r, s, l As Single
Private Sub cmdcls_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Cmdjisuan_Click()
r = Val(Text1.Text)
Call Fortrandll(r, s, l)
Text2.Text = Str(l)
Text3.Text = Str(s)
End Sub
Private Sub cmdquit_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
VB模块声明为:
Declare Sub Fortrandll Lib "e:\Fortran设计\圆计算\jisuan\Debug\jisuan.dll" (r As Single, s As Single, l As Single)
运行出现错误为:
实错误‘453’找不到DLL入口Fortrandll in e:\Fortran设计\圆计算\jisuan\Debug\jisuan.dll
希望那位大侠帮小弟看看问题出在那里
fortran动态连接库代码为:
Subroutine Fortrandll(r,s,l)
!DEC$ ATTRIBUTES DLLEXPORT:: Fortrandll
!DEC$ ATTRIBUTES ALIAS: 'Fortrandll' :: Fortrandll
real,INTENT(IN)::r
real,INTENT(OUT)::s,l
real:: pi
parameter(pi=3.1415926)
s=r*r*pi
l=2*pi*r
end Subroutine
VB界面、按钮及调用代码为:
Option Explicit
Dim r, s, l As Single
Private Sub cmdcls_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Cmdjisuan_Click()
r = Val(Text1.Text)
Call Fortrandll(r, s, l)
Text2.Text = Str(l)
Text3.Text = Str(s)
End Sub
Private Sub cmdquit_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
VB模块声明为:
Declare Sub Fortrandll Lib "e:\Fortran设计\圆计算\jisuan\Debug\jisuan.dll" (r As Single, s As Single, l As Single)
运行出现错误为:
实错误‘453’找不到DLL入口Fortrandll in e:\Fortran设计\圆计算\jisuan\Debug\jisuan.dll
希望那位大侠帮小弟看看问题出在那里