delphi - TShellTreeView 在哪里?

标签 delphi delphi-xe7 delphi-10-seattle

我正在尝试在 Delphi 10 Seattle 中编译一个旧项目并收到以下错误消息

class TShellTreeView not found click cancel to ignore.....

TShellTreeView 是一个设计时组件,是 ShellCtrls 包的一部分,通常在 Samples 包中随 Delphi 一起提供,通常在:

C:\Users\Public\Documents\Embarcadero\Studio\xx.x\Samples\Object Pascal\VCL\

现在好像没有了。这个包裹去了哪里?

最佳答案

ShellControls 设计时包以及 Samples 包中的许多其他非常旧的项目已在 XE7+ 中删除。

如果你想要一个现成的设计时包,你仍然可以在 SourceForge repository here 中获得 XE6 附带的最后一个版本。 .

链接到此存储库的相关文档页面是 the XE6-specific page.特定于更高版本的 Delphi 的文档页面将链接到特定于这些版本的新 示例 存储库。要安装该包,请打开 vclshlctrls.dproj 文件,右键单击 Project Manager 中的 ShellControls.bpl 包并选择 安装

请记住,这现在是一个废弃的包 - 您可能需要进行更改才能在新版本中编译它。


但是,当前更新的 .pas 文件已集成到 VCL 源代码中。最好的选择可能是使用这些来制作您自己的设计时包。为此,您需要在以下位置找到来源:

Vcl.Shell.ShellConsts.pas
Vcl.Shell.ShellCtrls.pas

in :

[ProgramFiles]\Embarcadero\Studio\17.0\source\vcl\

  • 接下来,将它们复制到新包的工作目录中。
  • 创建一个新包(文件 -> 新建 -> 包)
  • 在您的工作目录中将包另存为 ShellControls.bpl 并添加两个源文件。
  • 编辑 Vcl.Shell.ShellCtrls.pas 的工作副本,将其添加为 interface 部分中的最后一项:

    procedure Register;
    
  • 并在 implementation 部分添加为第一项:

    procedure Register;
    begin
      RegisterComponents('Shell Controls', [TShellListView]);
      RegisterComponents('Shell Controls', [TShellTreeView]);
      RegisterComponents('Shell Controls', [TShellChangeNotifier]);
    end;
    
  • 保存包。右键单击项目管理器中的 .bpl 并选择 -> Install。接受 IDE 通知您的任何必需引用,您应该完成。

关于delphi - TShellTreeView 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34905926/

相关文章:

delphi - 为什么箭头键导航在TWebBrowser中不起作用?

delphi - 编译器完成编译后出现警告 "Symbol TMemoryManager is deprecated"

multithreading - 在挂起模式下创建的Delphi线程可在Windows 2012 Server上自行启动

delphi - Jpeg 到 Bmp 的转换需要不合理的时间

multithreading - 如何使我的应用程序在多个内核上运行?

delphi - 在 PC 之间共享 Delphi 中的公共(public)内存区域

delphi - 如何同步滚动 2 个不同高度的 TVirtualStringTree 控件?

ios - Apple App Store 中的 "App is crashing on startup",但它在 Debug/Adhock 中运行良好?

delphi - NumbersOnly TEdit Delphi 提示不起作用

Delphi编辑unicode表格数据