[DUG] basic question
Conor Boyd
Conor.Boyd at trimble.co.nz
Wed Jul 25 21:08:31 NZST 2007
I'll say it again: no you won't. ;-)
I'll clarify my posting for you.
If you tried what the original poster said (I'm using D2006), and
recreated it (i.e. create two forms, make the second one not
autocreated, add a method to the second form with a simple ShowMessage
in it, and call that method on the object reference for the form), you
will definitely not get an AV.
Using the references in your line below, you can happily invoke a method
on your FormB variable with no AVs - if, as Myles said, there is no code
in that method that refers to instance properties, fields, etc.
E.g.
In your project source the following will (maybe surprisingly) not AV:
begin
Application.Initialise;
Application.CreateForm(TFormA, FormA);
FormB.SomeMethodThatOnlyCallsShowMessage;
Application.Run;
end;
Maybe the compiler has inlined it or something, I don't know.
C.
-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of Edward Koryagin
Yes I do ;)
if you don't have
Application.CreateForm(TFormB, FormB); in your project source you will
have AV
--- Conor Boyd <Conor.Boyd at trimble.co.nz> wrote:
> No you don't. ;-)
>
> Try it.
>
> C.
>
> -----Original Message-----
> From: delphi-bounces at delphi.org.nz
> [mailto:delphi-bounces at delphi.org.nz]
> On Behalf Of Edward Koryagin
>
> Remove FormB from AutoCreate list and you will have
> AV.
>
> --- David Moorhouse <delphi at moorhouse.net.nz> wrote:
>
> > The Delphi compiler creates an implicit parameter
> to Self and places
> > it before the other params to the method.
More information about the Delphi
mailing list