K
koala
Unregistered / Unconfirmed
GUEST, unregistred user!
在Fortran中定义如下:
subroutine test(a, b, c)
!MS$ATTRIBUTES ALIAS : 'MyTest' :: test
!MS$ATTRIBUTES DLLEXPORT :: test
!MS$ATTRIBUTES REFERENCE :: a,b,c
Integer a,b,c
dimension a(3), b(3), c(3)
integer i
do
i=1, 3
c(i)=a(i)+b(i)
enddo
end subroutine
Delphi如下定义:
procedure Test(var a, b, c :array of Integer);
Stdcall;external 'testdll.dll' name 'MyTest';
procedure TForm1.Button1Click(Sender: TObject);
var
a, b, c :array[1..3] of Integer;
i :integer;
begin
for i :=1 to 3do
begin
a :=i*30;
b :=i*5+50;
end;
Test(a, b, c);
for i:=1 to 3do
ListBox1.Items.add(InttoSTr(c));
end;
总是出错,
哪位大侠在Delphi中调用过Fortran的DLL, 请帮忙。
另外,Fortran中的COMMON数据如何与Delphi共用?
subroutine test(a, b, c)
!MS$ATTRIBUTES ALIAS : 'MyTest' :: test
!MS$ATTRIBUTES DLLEXPORT :: test
!MS$ATTRIBUTES REFERENCE :: a,b,c
Integer a,b,c
dimension a(3), b(3), c(3)
integer i
do
i=1, 3
c(i)=a(i)+b(i)
enddo
end subroutine
Delphi如下定义:
procedure Test(var a, b, c :array of Integer);
Stdcall;external 'testdll.dll' name 'MyTest';
procedure TForm1.Button1Click(Sender: TObject);
var
a, b, c :array[1..3] of Integer;
i :integer;
begin
for i :=1 to 3do
begin
a :=i*30;
b :=i*5+50;
end;
Test(a, b, c);
for i:=1 to 3do
ListBox1.Items.add(InttoSTr(c));
end;
总是出错,
哪位大侠在Delphi中调用过Fortran的DLL, 请帮忙。
另外,Fortran中的COMMON数据如何与Delphi共用?