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 s
char);external 'project1.dll';
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
s
char;
begin
sendstring(s);
edit1.Text:=string(s);
end;
end.
DLL部分的代码
library Project2;
uses
SysUtils,
Classes;
procedure sendstring(var s
char);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 s
![Stick Out Tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
s
![Stick Out Tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
begin
sendstring(s);
edit1.Text:=string(s);
end;
end.
DLL部分的代码
library Project2;
uses
SysUtils,
Classes;
procedure sendstring(var s
![Stick Out Tongue :p :p](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f61b.png)
begin
s:='hello';
end;
exports
sendstring;
{$R *.res}
begin
end.
在编译unit的时候提示 在方法或属性的后面不允许域定义
为什么?