DIGITAL Visual Fortran 6.0에서 만든 DLL 파일을 DELPHI 4.0
에서 호출할려고 하는 데 잘 안됩니다. 제가 한 소스는 아래에
첨부하였습니다. 꼭 도와주세요~.
Digital Visual Fortran Version 6.0 ( DLL Source, sample.dll )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
subroutine mul(a,b,c)
!DEC$ ATTRIBUTES stdcall:: mul
!DEC$ ATTRIBUTES value :: a
!DEC$ ATTRIBUTES REFERENCE :: b,c
INTEGER(4) a, b, c
a = b * c
end subroutine mul
Inprise Borland Delphi C/S Version 4.0 ( Main Source )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
Tmain = class(TForm)
ButtonSolve: TButton;
EditNum1: TEdit;
EditNum2: TEdit;
EditAns: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure ButtonSolveClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
main: Tmain;
implementation
procedure mula(var a:longint; b,c:longint); stdcall; external 'sample.dll';
{$R *.DFM}
procedure Tmain.ButtonSolveClick(Sender: TObject);
var
a, b, c : longint;
begin
b := StrToInt(EditNum1.text);
c := StrToInt(EditNum2.text);
mula(a,b,c);
EditAns.text := IntToStr(a);
end;
end.