That's fine for classes I declare myself.  But those aren't the problem,
it's all the Delphi and 3rd party classes.  Do I (for example) edit ExtCtrls
to include a RegisterClass(TPanel) in it's initialization?  Definitely not!
A single call to RegisterClasses is better.

In fact, even for classes I declare myself it's probably better not to
include the RegisterClass in the initialization of the same unit, as that
call will only of use to those programs which could possibly load something
that uses the class.  Otherwise I'm bulking up my programs with class
definitions that aren't needed.  After all, if I register the class, the
linker won't remove it from the executable even if it's not ever used (well
when I register it it *is* used, by definition).

Of course for my loading program I'm bulking up my program with a whole lot
of class definitions which have to be explicitly enumerated and most of
which probably won't ever be needed, but there doesn't seem to be any way
around it.

Cheers,
Carl

-----Original Message-----
From: Cooke, Andrew [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 25 May 2000 4:46 PM
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Registering classes


Why not call RegisterClass in the initialization section of each unit that
declares that class?
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to