本文介绍了您如何解决“无法为TClassName加载单位UnitName符号信息。您要尝试自己查找该文件吗?”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在delphi中,创建ActiveX控件比现在更加流行。但是,仍然可以使用Delphi创建ActiveX控件。这个问题假设使用Delphi 2007,但无论使用什么版本的Delphi,都应该相同。

In delp creating ActiveX controls was something that was once more popular than it is now. However it remains possible to create ActiveX controls with Delphi. This question assumes Delphi 2007, but it should be the same no matter what Delphi version you use.

在创建ActiveX控件时,Delphi中会出现一些奇怪的错误。就我而言,我现在可以不再
导入要导入和包装的某个类,而Delphi不会告诉我为什么要这么做,只是它无法加载单元符号信息。

There are some strange errors in Delphi when you create ActiveX controls. IN my case, I can now no longer import a certain class that I am trying to import and wrap, and Delphi won't tell me why any more, just that it could not load the unit "symbol information".

在这种情况下,我包装了一个开放源代码控件,而我包装它的前几次尝试都很好,但是我发现我必须重做导入操作找到丢失ActiveX包装器的方式编写的属性。重新生成ActiveX包装器比手工修复要容易。直到您像这样停止感冒为止:

In this case, I am wrapping an open source control, and my first few attempts to wrap it worked fine, but I found that I had to redo the import once I found properties that were written in a way that the ActiveX wrappers were missed. It's easier to regenerate an ActiveX wrapper than to fix it by hand. Until you get stopped cold like this:

 Error

 Could not load unit [unit] symbol information for [TClassName]. 
 Do you want to try to find this file yourself?

如果单击是,将显示一个浏览(打开文件)对话框,并且该对话框设置了文件过滤器到 DCU。这意味着,它希望我找到此设备的DCU文件。如果我浏览或不浏览,结果都是一样的。

If I click Yes, I get a browse (file open) dialog and it has the file filter set to "DCU". Which means, it wants me to find the DCU file for this unit. If I browse to it, or if I don't, the results are the same. No amount of recompiling will clear this error condition.

没有人知道此错误的真正含义,更好的是,如何解决该错误?谷歌搜索此特定错误消息显示它出现在英语以外的论坛中,但如此晦涩难懂,尚无记录。

does anyone know what this error really means, and better yet, how to fix it? Googling this particular error message shows it comes up in forums other than English, but is so obscure nobody has yet documented it.

推荐答案

Delphi中的库路径存在一个问题,为了使ActiveX Control向导正常运行,解析器解析所讨论的单元所需的所有源都必须位于库路径中。由于ActiveX控件向导在项目外部起作用,因此您的项目搜索路径不包含在用于解析要包装并转换为ActiveX控件的VCL控件源的文件夹列表中。

There is an issue with the Library Path in Delp that for the ActiveX Control wizard to work properly, all sources needed for the parser to parse the unit in question must be in the library path. Since the ActiveX control wizard functions outside your project, your project search paths are NOT included in the list of folders that are used to parse the sources of the VCL control that is to be wrapped and turned into an ActiveX Control.

解决方案:

修复库路径。

这篇关于您如何解决“无法为TClassName加载单位UnitName符号信息。您要尝试自己查找该文件吗?”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 16:02