程序代码如下
with tform(frmid) do //frmid是传递的表单参数
begin
for i:= ComponentCount -1 downto 0 do
begin
if (Components[i] is TAction) then
(Components[i] as TAction).Enabled:=false;
end;
end;
下面代码是在主程序过程中可以正常运行,然后我把它做成dll过程过就不能了。编译也不会出错,可程序运行中出现错误
1、先是(Components[i] is TAction)找不到taction
2、我把 if (Components[i].classname='TAction') then 这样后,下面的(Components[i] as TAction).Enabled:=false;就出现了转换错误。
with tform(frmid) do //frmid是传递的表单参数
begin
for i:= ComponentCount -1 downto 0 do
begin
if (Components[i] is TAction) then
(Components[i] as TAction).Enabled:=false;
end;
end;
下面代码是在主程序过程中可以正常运行,然后我把它做成dll过程过就不能了。编译也不会出错,可程序运行中出现错误
1、先是(Components[i] is TAction)找不到taction
2、我把 if (Components[i].classname='TAction') then 这样后,下面的(Components[i] as TAction).Enabled:=false;就出现了转换错误。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货