Hi all,

I always thought that an application always had one Application-instance
from the TCustomAppliction class. But at this moment this is not the
case for fcl-web applications, or daemon-applications which are using
Lazarus-forms.

Take for example the fpcgi unit from fcl-web. (not the old one from
Lazarus) There a global variable Application is defined and initialized
and finalized. This Application should be used throughout the program.

But nowadays we are forced to include the 'interfaces' unit, which uses
the 'forms' unit which has it's own global Application variable. So
there are two TCustomApplication descdendents initialized during the
program!

Now in daemonapp.pp to avoid this kind of problems with several
different kinds of daemon-applications (the one with lazarus and
without) it is done somewhat different. The function Application is
defined as a singleton and which kind of application is created depends
on a variable which has to be set by units implementing descendents of
TDaemonApp.

Can we move this functionality to the CustApp unit? That way you can
always refer to custapp.Application and you have the 'current'
application instance. 

This will be a problem when forms which are loaded using lazarus
resource system depend on an instance of Lazarus' TApplication-class...
(But maybe that should be avoided?)

Joost




--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to