1

我的 Delphi 7 项目中有许多带有“定稿”部分的单元。

如何确保最后执行一些代码?

我试图在 .dpr 文件中写一个“最终化”部分,但它没有编译。

4

1 回答 1

5

There's a good explanation on the finalization ordering for code in Unit finalization order for application compiled with run-time packages - the questioner came up with a reasonable way to ensure that his ordering worked - add the module at the start of the uses clause of the project, and ensure that the module in question does not use any other units.

Edit: Took David Heffernan's addendum on-board.

于 2012-07-10T14:26:19.317 回答