Delphi 2007 中的一个项目在 IDE 对象检查器的事件中不显示过程名称
我有一个 2007 年的 Delphi 项目,它在 IDE 中的对象检查器事件(例如 Form OnClose、OnCreate 或 OnShow)中不显示过程名称。代码就在那里,如果您单击 OnCreate(例如),您将看到代码,并且 IDE 会填写过程名称。但是,重新加载后,IDE 中再次丢失这些过程。
当 Delphi 关闭时,这个相同的项目也会导致各种错误消息,但我不确定这是否相关(在此 Delphi 下开发的其他项目没有这样做,但这个是最大的应用程序并使用多个第 3 方加载项库)。
我已将此应用程序移至各种 Delphi 2007 安装中,并且其反应相同,因此这不是损坏的 Delphi 情况。有什么方法可以重建或修复这样的损坏项目吗?任何帮助将不胜感激。
I have a Delphi project in 2007 that doesn't show the procedure names in the Object Inspector's Events such as Form OnClose, OnCreate or OnShow in the IDE. The code is there and if you click on OnCreate (for example) you are taken to the code and the IDE fills in the name of procedure. However on reload, the procedures are missing from the IDE again.
This same project causes various error messages when Delphi closes also, but I am not sure if this is related (no other project developed under this Delphi does but this one is the largest app and uses several 3rd party add-in libraries).
I have moved this app to various Delphi 2007 installations and it reacts the same, so it isn't a corrupt Delphi situation. Is there any way to rebuild or fix a corrupt project like this? Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会尝试删除所有文件并仅保留 dpr 和 pas/dfm 文件,以防项目文件损坏。
我还会仔细检查是否存在任何表单继承混乱,因为我在继承的事件处理程序中看到了一些类似的问题。 (直接看dfm文件)
I would try to remove all the files and keep only the dpr and the pas/dfm files in case it's a corrupted project file.
I would also double check if there is any Form inheritance mess, as I have seen somewhat similar issues with the inherited event handlers. (look at the dfm files directly)
尝试删除所有.DCU,关闭Delphi,重新启动Delphi,然后重建您的项目。
Try delete all the .DCU's, close Delphi, restart Delphi then rebuild your project.
Delphi 的 IDE 在不警告您的情况下对您的代码进行了多种修改。
特别是:如果您在 dfm 中链接了一个回调(例如:“TMyForm.FormCreate”),并且 IDE 检测到该函数的主体为空,则当您保存单元时,IDE 会在保存单元之前删除声明和实现。文件。
在函数体中添加任何内容(甚至是简单的“//”)可以防止这种情况:在关闭 Delphi 之前尝试在函数中键入一些代码或一些注释。
至于Delphi关闭时出错,原因可能有很多。
您是否安装了任何第三方组件或专家?
您是否尝试过安装 IDEFixpack for D2007 ?
Delphi's IDE takes several liberties with your code without warning you.
In particular : if you have a callback (eg: "TMyForm.FormCreate") linked in the dfm, and the IDE detects that the function's body is empty, when you save your unit, the ide removes the declaration and the implementation before saving your file.
Adding anything (even a simple "//") in the function's body prevents this : try typing some code or some comment in your function before closing your Delphi.
As for errors when Delphi closes, there can be so many reasons.
Do you have any third-party components or experts installed ?
Have you tried installing IDEFixpack for D2007 ?