On Wed, 17 Aug 2005, Mattias Gaertner wrote:

> On Wed, 17 Aug 2005 18:50:12 +0200
> Marc Weustink <[EMAIL PROTECTED]> wrote:
> 
> > Mattias Gaertner wrote:
> > > On Wed, 17 Aug 2005 15:13:35 +0200 (Romance Daylight Time)
> > > Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> > > 
> > > 
> > >>
> > >>On Wed, 17 Aug 2005, Mattias Gaertner wrote:
> > >>
> > >>
> > >>>>>I don't know, why the Screen forms must have separate names, but
> > >>>>>nevertheless: implemented.
> > >>>>
> > >>>>Separate names ????
> > >>>
> > >>>Sorry. I meant unique names.
> > >>>
> > >>>
> > >>>
> > >>>>All created froms are "registered" with the screen object, so it knows
> > >>>>all forms and thus all names.
> > >>>
> > >>>True.
> > >>>Is there any reason, why all forms must have unique names?
> > >>
> > >>No.
> > >>Only if they are owned by the same owner. So if all forms are owned by
> > >>Application, they must have different names. This is also true in
> > >>Delphi, it is a TComponent thing.
> > > 
> > > 
> > > Hey, wait a minute. That was my point. ;)
> > > By checking the Screen all forms, independent of their Owner have unique
> > > names. So, it has nothing to do with TComponent.
> > > BTW: forms can have any owner and in the given example a form was the
> > > owner of two other forms.
> > 
> > Indeed and that didn't work with your first solution. I guess therefore 
> > borland checkes against Screen.Forms  (and only during loading at runtime)
> 
> Do you mean, it's only a hack?
> I would have expected, the global uniqueness is because Form names can be
> used for IPC (COM/RPC/...).

No, I don't think this is the reason. 
The streaming itself is probably the reason, this way Borland can always
fix a reference of the kind

  Datasource=MyDataModule.DataSource;

in a stream, even if the datamodule was created without Application as the 
owner.
Datamodules and forms are both added to the Screen instance. 

For instance in a service application, this would be so: the service 
datamodules 
are NOT owned by Forms.Application, but by SvcMgr.application; A form would 
never 
"find" the datamodule if it looked only under forms.application.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to