在Delphi中按加载顺序生成表单/单元列表的最佳方法是什么? [英] What is the best way in Delphi to generate a list of forms/units in the order they load?
问题描述
我遇到一个问题,即文件在启动时会不断删除,而我无法找到负责的代码。我结束了向所有单元添加Vcl.Dialogs的操作,并创建了一个初始化部分,如下所示:
I had an issue where a file kept deleting on startup and I couldn't track down the code responsible. I wound up adding Vcl.Dialogs to all the units and creating an initialization section that looked like this:
initialization
begin
ShowMessage('Inside [Unit Name Here]');
end;
这很痛苦。是否有一种简单的方法可以按触发顺序生成表单/单元列表?
This was quite a pain. Is there an easy way to generate a list of forms/units in the order in which they fire off?
更新时间:2019-08-01 (有用的MAP链接)
以下两个链接可帮助您了解DELPHI地图文件
Here are two links that may assist in understanding DELPHI map files
推荐答案
您可以检查地图文件的segments部分。 C = ICODE的条目是按照执行顺序具有初始化部分的单元。
You can inspect the segments section of the map file. The entries with C=ICODE are those units with initialization parts in the order they are executed.
这篇关于在Delphi中按加载顺序生成表单/单元列表的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!