What you want to do cannot be done internally. You need to modify the
compiled exe.

However, you should not attempt to do anything before sysinit and system
have been initialised.
MemChk shows how it is done while running - but of course in your case this
is to late.

There is an exception handler with code to do this on this site.

http://www.madshi.net/

Myles.

-----Original Message-----
From: Leigh Wanstead [mailto:[EMAIL PROTECTED]
Sent: Monday, 25 August 2003 10:50
To: Multiple recipients of list delphi
Subject: [DUG]: How to control initialization/finalization sequence?


Hello everyone,

I read help file about initialization.

----------------------------------------------------------------------------
--------------------
The initialization section is optional. It begins with the reserved word
initialization and continues until the beginning of the finalization section
or, if there is no finalization section, until the end of the unit. The
initialization section contains statements that are executed, in the order
in which they appear, on program start-up. So, for example, if you have
defined data structures that need to be initialized, you can do this in the
initialization section.

The initialization sections of units used by a client are executed in the
order in which the units appear in the clients uses clause.

----------------------------------------------------------------------------
--------------------

There is a procedure InitUnits in system.pas. The question is how to change
the unit initialization/finalization order by modify InitContext.InitTable^?

I simply put some unit I want to load first in the first line in project
uses clause, it seems that SysInit, System unit will always be initialized
first.

TIA

Regards
Leigh


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to