Differences in using Constructor and unit Initialization block

From: Raptor (bogus_at_none.com)
Date: 01/28/05


Date: Fri, 28 Jan 2005 03:14:35 -0800

OK, I'm creating a class/component in a unit.

When the app starts up, it seems that the unit's Initialization block is
activated first, which makes some sense--it would seem reasonable that the
unit's code would have to be processed before a class/component therein
could be created.

What, I'm wondering, kinds of things would one place in Initialization and
what would we reserve for .Create?

Would reading the app ini file be dangerous to do from Initialization, for
example, as the code for the IniFiles unit may not be loaded, or does the
fact that IniFiles appears in the unit's Uses clause guarantee the code will
be present?

Raptor



Relevant Pages

  • Re: entering a function after dialog is displayed
    ... There are problems with "lengthy initialization" that cause problems. ... will repaint the app, the dialog, etc. is dead. ... progress bar, an UpdateWindow is required, so the only part of the app that comes up is ... again that programming GUI apps in the raw API is a Fundamentally Losing Idea. ...
    (microsoft.public.vc.mfc)
  • Re: Differences in using Constructor and unit Initialization block
    ... >> Would reading the app ini file be dangerous to do from ... >> example, as the code for the IniFiles unit may not be loaded, or does ... >> fact that IniFiles appears in the unit's Uses clause guarantee the ...
    (alt.comp.lang.borland-delphi)
  • ADO initialization fails on W2003
    ... ADO initialization fails on W2003 Server, ... This is the first time this app has been compiled or run on this system. ...
    (borland.public.delphi.database.ado)
  • Re: ngen.exe question
    ... If you are doing a lot of initialization on app ... > I'm trying to improve the startup time of a simple winform app using ...
    (microsoft.public.dotnet.framework.performance)
  • Re: ngen.exe question
    ... If you are doing a lot of initialization on app ... >> I'm trying to improve the startup time of a simple winform app using ...
    (microsoft.public.dotnet.framework.performance)