【发布时间】:2011-02-22 22:26:41
【问题描述】:
TTest= class
public abc:Integer;
type
TTest2 = class
procedure test;
end;
end;
procedure TTest.TTest2.test();
begin
abc:=5; //'Inaccessible here'
end;
我得到“实例成员 abc 无法在此处访问”。
情况很严重。我必须使用线程,但由于 TThread 是抽象的,所以自己的类应该继承它。在我的情况下,需要线程的类已经继承了另一个不能继承 TThread 的类......所以这是不可能的。 我的场景是继承 TThread 的嵌套类,并在下面声明它。但是 Execute();方法必须使用其父类的成员。
我该怎么做?为什么会出现这个错误?
【问题讨论】:
标签: delphi oop delphi-2009