删除 IWTreeViewItems 导致表单发布异常
在我的表单上,我有一个 IWTreeView 和两个按钮。一个按钮删除一些 IWTreeViewItems,另一个按钮释放表单:
procedure TIWForm1.IWButton1Click(Sender: TObject);
begin
IWTreeView1.Items[0].Subitems.Clear;
end;
procedure TIWForm1.IWButton2Click(Sender: TObject);
begin
Release;
end;
删除 IWTreeViewItems 后释放表单会导致异常:
引发的错误消息 应用程序:访问冲突 模块中地址004E0D8A 'TryTree.exe'。读取地址 00000000
当有另一个表单处于活动状态并且应用程序没有被此表单释放终止时,错误消息为:
引发的错误消息 应用程序:列出索引 界限(-1)
使用 IntraWeb 9.0.42(由于 TMS 控件和 Delphi 2006,TMS 尚未使用 10.0.17 和 Delphi 2006 进行测试)。
我尝试以 IWTreeView1.ClearAll 形式销毁,但这根本没有帮助。
On my form I have a IWTreeView and two buttons. One button deletes some IWTreeViewItems, the other releases the form:
procedure TIWForm1.IWButton1Click(Sender: TObject);
begin
IWTreeView1.Items[0].Subitems.Clear;
end;
procedure TIWForm1.IWButton2Click(Sender: TObject);
begin
Release;
end;
Releasing the form after deleting the IWTreeViewItems causes an exception:
Error message raised by the
application: Access violation at
address 004E0D8A in module
'TryTree.exe'. Read of address
00000000
When there is another form active and the application is not terminated by this form release, the error message is:
Error message raised by the
application: List index out of
bounds (-1)
Using IntraWeb 9.0.42 (because of TMS controls and Delphi 2006, as TMS has not tested with 10.0.17 and delphi 2006).
I tried to IWTreeView1.ClearAll in the form destroy, which did not help at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而不是 SubItems.Clear
我现在使用This Works, 。仍然对更好的解决方案持开放态度,也许不涉及遍历所有子项的循环。
Instead of SubItems.Clear I now use
This works. Still open for better solutions, maybe not involving a loop through all subitems.