(1)在 Fortran PowerStation 4.0 下,编制可供 VB 调用的.dll 文件,示例代码:
subroutine forcx(a,b,c)
!ms$if .not. defined(linkdirect)
!ms$attributes dllexport :: HWJSVB
!ms$endif
integer a,b,c
a=b+c
end
(2) 在 VB 下编写如下代码:
Private Declare Sub forcx B Lib "dll.dll" Alias "_ FORCX @12" (ByRef a As integer, ByRef b As
integer, ByRef c As integer)
Sub callfor()
Dim a as integer, b as integer ,c as integer
B=1 : c=2
Call forcx(a,b,c)
End