Delphi 2009 ShellTreeView / ShellListView Fix

When a Delphi 2009 project is closed using ShellTreeView / ShellListView on the main form in the IDE index outside of (0), exceptions are thrown. Is there a fix for ShellTreeView / ShellListView, so the exceptions can be eliminated?

+3
source share
4 answers

This is the first thing I heard about it. If this is a consolation, I can reproduce it here.

The first thing you should do is probably the error report file in Quality Central and ask in the Codegear NNTP newsgroups.

, 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;
+3
{ 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;
0

, ... ShellListView , . , ShellListView, ShellTreeView.

, .

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;
0

All Articles