为什么添加动作会导致Delphi中出现致命错误 [英] Why does adding Action cause Fatal Error in Delphi

查看:302
本文介绍了为什么添加动作会导致Delphi中出现致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Delphi2009.我的程序一直在编译并且运行良好.我使用动作列表并将其内置到程序中-尽管我已经有一段时间没有更改它们了.

I'm using Delphi 2009. My program has been compiling and running fine. I use Action lists and have them built into my program - although I haven't changed them in a while.

因此,今天我将按照完成的常规方式将新操作简单地添加到我的ActionList中.不做任何其他事情,我现在构建并运行程序,并得到以下错误:

So today I go to simply add a new action to my ActionList in the normal manner that it is done. Without doing anything else, I now build and run my program and I get the following error:

[DCC致命错误] Userface.pas(1):F2092程序或单元'Userface'递归使用其自身.

[DCC Fatal Error] Userface.pas(1): F2092 Program or unit 'Userface' recursively uses itself.

我没有做任何更改任何uses子句的事情.我找不到自己调用的Userface单元或调用另一个调用Userface的单元的任何实例.我将潜在的递归调用按应有的方式放在了实现"部分.

I have done nothing to change any of the uses clauses. I can't find any instances of my Userface unit calling itself or calling another unit that calls Userface. I place potentially recursive calls in the Implementation section as they should be.

如果我不保存就退出了Delphi,请重新构建并运行它,它将运行良好.如果我再次尝试将新操作添加到操作列表中,则会再次发生致命错误.

If I exit Delphi without saving, rebuild and run it, it runs fine. If I attempt again to add a new action to the action list, the fatal error happens again.

我不知所措.如果能解决该问题,我将不胜感激.

I'm at a loss to figure out what is happening. I would appreciate any help to figure out how to get around this.

在Uwe回答之后,我再次检查以确保它仍然在发生.果然,正如我在对Uwe的评论中所述,我又做了一次.建造后,它又发生了.

After Uwe's answer, I double checked to make sure it was still happening. Sure enough, I did it again as I described in my comment to Uwe. After building, it happened again.

...但是,由于偶然,在项目菜单下我错过了选择构建"并选择了编译".它编译良好.然后,我尝试构建,现在构建可以正常工作.没有致命错误!一切对我来说再好不过了.

... But then, by accident under the Project Menu I missed picking "Build" and selected "Compile" instead. It compiled fine. Then I tried building and now the build works correctly. No Fatal Error! Everything seems fine for me again.

如果我尝试添加其他操作然后进行构建,则会再次出现该错误.但是,如果我进行编译,则可以成功构建它-因此至少我有一种解决方法.

If I try to add another action and then build, the error comes up again. But if I compile, then I can build it successfully - so at least I have a workaround.

这一定是小故障.我不知道发生了什么有人知道这是什么或为什么会发生吗?

This must be some sort of a glitch. I don't know what happened. Does anybody know what this is or why it might be happening?

跟进.正如Marjan所说,它可能在其他情况下发生,其中一种情况发生在我身上.因此,这可能与我的问题所要求的添加动作没有直接关系.

Followup. As Marjan states, it can occur in other circumstances, and one of those happened to me. So it is probably NOT directly related to the adding an action, which my question asks.

尽管如此,到目前为止,对我来说这是相对罕见的事情,只是变成了小麻烦.它可能已经在Delphi 2010中修复了,而我的最终解决方案将是当我下次添加到64位或多平台的下一次升级到Delphi 2011或12时.

None-the-less, it is a relatively rare happening so far for me and has only turned into a minor annoyance. It may already have been fixed in Delphi 2010, and my ultimate solution will be when I next upgrade to Delphi 2011 or 12 once they add either 64-bit or multi-platform.

推荐答案

根据要求将我的评论作为答案.

As per request my comment as an answer.

不知道它为什么会发生,但是如果有什么安慰的话,我也看到它在其他情况下也会发生.紧随更改之后的构建将失败,进行编译,然后构建将成功.

Don't know why it may be happening, but if its any consolation, I have seen it happen in other situations as well. A build immediately following a change would fail, a compile, then a build would succeed.

在这些情况下有时还有用的是在编译/生成之前显式保存所有内容.

What sometimes also helps in these situations is an explicit Save All before the compile/build.

我想这可能与IDE中的计时和缓存有关.可能还涉及启用代码洞察,错误红色衬里等的编译线程.

I guess it may have something to do with timing and caching in the IDE. Possibly the compilation thread(s) that enable code-insight, error red lining etc are involved as well.

这篇关于为什么添加动作会导致Delphi中出现致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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