当 Delphi 2009 项目在 IDE 索引中的 mainform 上使用 ShellTreeView/ShellListView 关闭时,会生成越界 (0) 异常。是否有针对 ShellTreeView/ShellListView 的修复程序,以便可以消除异常?
Bill
问问题
3542 次
4 回答
3
这是我第一次听说这个。如果有什么安慰的话,我可以在这里复制它。
您应该做的第一件事可能是在Quality Central 中提交错误报告,并在 Codegear NNTP 新闻组上提问。
另外,尝试将 TCustomShellListView.GetFolder 更改为下面的代码,看看你是如何开始的。您需要重新构建包 - 并注意 D2009 出于某种原因在 Windows\System32 中安装了此包的第二个副本。我将其重命名为(到目前为止)没有任何不良影响。
function TCustomShellListView.GetFolder(Index: Integer): TShellFolder;
begin
if Index < FFolders.Count then
Result := TShellFolder(FFolders[Index])
else
Result := NIL;
end;
于 2008-12-31T16:57:39.963 回答
0
到目前为止,没有任何建议可以解决问题......但是如果我从演示项目中删除 ShellListView 组件然后关闭项目,则不会创建异常。我认为问题出在 ShellListView 组件而不是 ShellTreeView。
问题可能比看起来要大。
于 2009-01-01T14:51:32.323 回答
0
该问题仅在设计时出现。
TShellListView
这是组件在文件中应用的解决方案ShellCtrls.pas
:
destructor TCustomShellListView.Destroy;
begin
ClearItems;
if not (csDesigning in ComponentState) then // Avoid design time error
FFolders.Free;
FreeAndNil(FRootFolder);
inherited;
end;
procedure TCustomShellListView.DestroyWnd;
begin
ClearItems;
// Avoid error in inherited DestroyWnd procedure :
if csDesigning in ComponentState then
Items.Count := 0;
inherited DestroyWnd;
end;
于 2009-09-14T14:50:32.027 回答
0
{ TCustomShellTreeView }
...
TCustomShellTreeView = class(TCustomTreeView, IShellCommandVerb)
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override; //$$jp shellctrl.pas 26.08.2007: missing "override"
procedure Refresh(Node: TTreeNode);
...
destructor TCustomShellTreeView.Destroy;
begin
//$$jp: ClearItems;
//$$jp: raises EInvalidOperation and access-violations (shellctrl.pas 26.08.2007)
FRootFolder.Free;
inherited;
end;
于 2009-01-01T01:26:01.183 回答