M
monkeyking1983
Unregistered / Unconfirmed
GUEST, unregistred user!
这是我的代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure sendstring(var schar);external 'project1.dll';
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
schar;
begin
sendstring(s);
edit1.Text:=string(s);
end;
end.
DLL部分的代码
library Project2;
uses
SysUtils,
Classes;
procedure sendstring(var schar);export;
begin
s:='hello';
end;
exports
sendstring;
{$R *.res}
begin
end.
在编译unit的时候提示 在方法或属性的后面不允许域定义
为什么?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure sendstring(var schar);external 'project1.dll';
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
schar;
begin
sendstring(s);
edit1.Text:=string(s);
end;
end.
DLL部分的代码
library Project2;
uses
SysUtils,
Classes;
procedure sendstring(var schar);export;
begin
s:='hello';
end;
exports
sendstring;
{$R *.res}
begin
end.
在编译unit的时候提示 在方法或属性的后面不允许域定义
为什么?