Z
zhaolibo
Unregistered / Unconfirmed
GUEST, unregistred user!
出现Access violation at address 0070d872 in module 'XXXX.EXE'. Read of address FFFFFFFF.(100分)<br />遍历组件,是Tpanel就销毁,然后创建一个新的,执行第一次的时候没问题,执行第二次就出现如题目所示的错误提示,不知是为什么?代码如下:
try
for m:=0 to componentcount-1 do
begin
if (Components[m] is Tpanel) then
begin
(components[m] as Tpanel).Free;
break;
end;
except
end;
p:=Tpanel.Create(frmdelr2);
p.Parent:=frmdelr2;
p.Left:=464;
p.Width:=335;
p.Top:=0;
p.Height:=553;
try
for m:=0 to componentcount-1 do
begin
if (Components[m] is Tpanel) then
begin
(components[m] as Tpanel).Free;
break;
end;
except
end;
p:=Tpanel.Create(frmdelr2);
p.Parent:=frmdelr2;
p.Left:=464;
p.Width:=335;
p.Top:=0;
p.Height:=553;