B
babyxinxin
Unregistered / Unconfirmed
GUEST, unregistred user!
如下代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
clsLoadDLLRes = class(TObject)
private
strDLLName:string;
protected
public
constructor Create;
destructor Destroy;
function GetDLLName:string;
procedure SetDLLName(para_DLLName:string);
published
property DLLName:string read GetDLLName write SetDLLName;
end;
var
Form1: TForm1;
clsLoadDLLResA: clsLoadDLLRes;
implementation
constructor clsLoadDLLRes.Create ;
begin
inherited create;
end;
destructor clsLoadDLLRes.Destroy ;
begin
inherited Destroy;
end;
function clsLoadDLLRes.GetDLLName :string;
begin
GetDLLName:=DLLName;
end;
procedure clsLoadDLLRes.SetDLLName(para_DLLName:string);
begin
DLLName:=para_DLLName;
end;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
clsloaddllresa:=clsloaddllres.Create ;
clsloaddllresa.DLLName :='abc';
clsloaddllresa.Destroy ;
end;
end.
运行时出错:
“Project Project.exe raised exception class EStrackOverflow with message 'Stack overflow'.Process stopped.Use Step or Run to continue.”
停在“ procedure clsLoadDLLRes.SetDLLName(para_DLLName:string);”的Begin处。
请问,这段代码有问题吗?应该如何做才对呢?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
clsLoadDLLRes = class(TObject)
private
strDLLName:string;
protected
public
constructor Create;
destructor Destroy;
function GetDLLName:string;
procedure SetDLLName(para_DLLName:string);
published
property DLLName:string read GetDLLName write SetDLLName;
end;
var
Form1: TForm1;
clsLoadDLLResA: clsLoadDLLRes;
implementation
constructor clsLoadDLLRes.Create ;
begin
inherited create;
end;
destructor clsLoadDLLRes.Destroy ;
begin
inherited Destroy;
end;
function clsLoadDLLRes.GetDLLName :string;
begin
GetDLLName:=DLLName;
end;
procedure clsLoadDLLRes.SetDLLName(para_DLLName:string);
begin
DLLName:=para_DLLName;
end;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
clsloaddllresa:=clsloaddllres.Create ;
clsloaddllresa.DLLName :='abc';
clsloaddllresa.Destroy ;
end;
end.
运行时出错:
“Project Project.exe raised exception class EStrackOverflow with message 'Stack overflow'.Process stopped.Use Step or Run to continue.”
停在“ procedure clsLoadDLLRes.SetDLLName(para_DLLName:string);”的Begin处。
请问,这段代码有问题吗?应该如何做才对呢?