为什么在装载另一个模块之前,该模块将无法保存? [英] Why would a module be unsavable until another module is loaded?

查看:77
本文介绍了为什么在装载另一个模块之前,该模块将无法保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从事的大多数单位都依赖于数据模块。

Most of the units I work on rely on a Data Module. One of the most annoying things I come accross is an error message telling me


模块X引用了另一个模块,直到模块Y被保存,才能保存

Module X references another module and cannot be saved until Module Y is loaded.

现在,我敢肯定 CheckNoFixups 尝试尝试 WriteRootStream 时出现此错误,并且未能保存有效的文本文件(希望此后不会出现 Catastrophic失败,然后我必须重新启动IDE,而仍然无法保存工作。)但是什么是好的原因?

Now, I'm sure there is a very good reason why CheckNoFixups raises this error while trying to WriteRootStream, and fails to save what is in effect a Text file (and hopefully this isn't followed by Catastrophic Failure where I must then restart the IDE while still unable to save my work.) but what is the good reason?

为什么不能在不打开包含各种功能和对象的文本文件的情况下单击保存,就像其他任何单元一样?一个DataModule有什么特别之处,这意味着我无法打开我正在处理的源代码,直到它打开为止。uses子句中的其他45个单元为什么不那么重要,所以必须将其打开?

Why am I unable to click save without opening anothing text file containing various functions and objects much like any other unit? whats so special about a DataModule that means I can't save the source I'm working on until it's open, why aren't the 45 other units in the uses clause so important they must be open?

编辑:
这是Delphi 2007

It's Delphi 2007

DataModule的声明为:

the Declaration of the DataModule is :

unit DataMD;

TRepDataMod = class(TDataModule)
...
var
  RepDataMod: TRepDataMod;


推荐答案

如果DataModule不属于打开的项目,则您表单中引用了DataModule的数据感知对象,无法验证其引用,因此我认为消息出现了。

If the DataModule is not part of the opened project the data aware objects in your form that reference the DataModule, cannot verify their reference and I think therefore the message comes up.

我只在移植旧版本时才看到此消息项目到新的Delphi版本,或者正在迁移到一组新的数据库组件。在正常情况下,我没有遇到此消息。

I only seen this message when I was porting an older project to a new Delphi version or were migrating to a new set of database components. In normal circumstances I haven't encountered this message.

在早期版本中,我没有看到该消息,并且可以保存表单/单位,但是引用是您的dfm中的文件被魔术删除了。

In earlier versions I haven't seen the message and the form/unit could be saved, but the references that were in your dfm were magicly deleted.

这篇关于为什么在装载另一个模块之前,该模块将无法保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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