我有一个非常基本和简单的类,如下所示:
单元装载机;
interface
uses
Vcl.Dialogs;
type
TLoader = Class(TObject)
published
constructor Create();
end;
implementation
{ TLoader }
constructor TLoader.Create;
begin
ShowMessage('ok');
end;
end.
从Form1中我这样称呼它:
procedure TForm1.Button1Click(Sender: TObject);
var
the : TLoader;
begin
the := the.Create;
end;
现在,在the := the.Create零件之后,delphi会显示消息,'ok'然后给我一个错误,然后说Project Project1.exe raised exception class $C0000005 with message 'access violation at 0x0040559d: read of address 0xffffffe4'.
它还显示此行:
constructor TLoader.Create;
begin
ShowMessage('ok');
end; // <-------- THIS LINE IS MARKED AFTER THE ERROR.
我是delphi的新手。我正在使用Delphi XE2,但无法解决此错误。有人给我显示路径或对此有解决方案吗?
当年话下
小唯快跑啊
皈依舞