打开dfm文件时出错-找不到类xxxx [英] Error opening a dfm file - Class xxxx not found

查看:120
本文介绍了打开dfm文件时出错-找不到类xxxx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过双击打开dfm文件时,出现以下错误:

While opening a dfm file by double clicking, I am getting following error:

Class TMyClass not found. Ignore the error and continue? Note: Ignoring the error may cause components to be deleted or property values to be lost.

当我单击取消时,出现以下消息

When I click Cancel, I get following message

Error creating form: Class TMyClass not found.

当我现在单击OK时,仅打开了pas文件。

When I click OK now, pas file is opened only.

在pas文件中添加了MyClass单元(这意味着TMyClass定义),并且其路径也已添加到我的搜索路径中(按住Ctrl键单击单元名称,将我带到单元文件中)

In pas file MyClass unit is added (which conatins the TMyClass defination) and its path is also added in my search path (Ctrl clicking on unit name, takes me to the unit file)

按照我的话,一切都很好。我不知道为什么会收到此错误,为什么我无法在RAD studio中打开此dfm文件?请帮忙。

Everything is fine as per me. I don't know why I am getting this error and why am I not able to open this dfm file in RAD studio? Please help.

推荐答案

要创建组件(放置在表单上),Delphi IDE应该按名称知道它并拥有它类加载到内存中。这意味着-它应该将该组件编译成二进制运行时程序包,并将相应的设计时程序包加载到IDE中,并且在加载过程中应调用 RegisterComponent

To create the component (that you placed on the form) Delphi IDE should know it by name and have its class loaded into memory. That means - it should have that component compiled into binary runtime package and that corresponding design-time package should be loaded into IDE and during the loading it should call RegisterComponent.

通常,所有这些操作都是在库安装过程中完成的。因此,如果您现在拥有用于Delphi 7的库,也只需为Delphi XE4安装它。

Usually this all is done during the library installation. So if you have that library for Delphi 7 now just install it for Delphi XE4 as well.

如果您的库没有安装程序或该安装程序不知道XE4,则您必须手动注册这些组件,就像Delphi文档要求您这样做一样。
这是一个多步骤的过程,因此您可能需要从入门者那里重新做一次。但是,如果幸运的话,您可能可以重用Delphi 7已经完成的工作。在最佳情况下,您只需要在XE4中重新编译运行时和designtime程序包,然后将这些设计时程序包安装到较新的IDE中即可。

If your library does not have installer or that installer does not know XE4, then you have to register those components manually, just like Delphi documentations asks you to do. That is a multi-step process, so you maybe would need to re-do it from starters. However with any luck you would probably be able to reuse the work already done for Delphi 7. At best case you only would have to recompile runtime and designtime packages in XE4 and then install those design-time ones into newer IDE.

  • http://www.cryer.co.uk/brian/delphi/error_class_not_found.htm
  • How to install a component from .pas file in delphi?
  • Delphi XE2: Encounter "Error Reading Form" when opening a project in IDE
  • Delphi XE4 "class not found" but compiles fine
  • http://docwiki.embarcadero.com/RADStudio/Rio/en/Installing_Component_Packages
  • http://delphi.about.com/library/howto/htinstallcomponent.htm
  • http://delphi.about.com/od/vclusing/ht/installwin32.htm

这篇关于打开dfm文件时出错-找不到类xxxx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆