;) May be we are talking about different things? In your case you were probably tricked by Delphi (optimizer??)...
Yes, if you have just ShowMessage in your method everything will be fine. But ... did you try to assign value to some local variable? You will have AV cause we don't have the object of the class. --- Conor Boyd <[EMAIL PROTECTED]> wrote: > 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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > 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 <[EMAIL PROTECTED]> wrote: > > > No you don't. ;-) > > > > Try it. > > > > C. > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] > > On Behalf Of Edward Koryagin > > > > Remove FormB from AutoCreate list and you will > have > > AV. > > > > --- David Moorhouse <[EMAIL PROTECTED]> > wrote: > > > > > The Delphi compiler creates an implicit > parameter > > to Self and places > > > it before the other params to the method. > > _______________________________________________ > NZ Borland Developers Group - Delphi mailing list > Post: [email protected] > Admin: http://delphi.org.nz/mailman/listinfo/delphi > Unsubscribe: send an email to > [EMAIL PROTECTED] with Subject: > unsubscribe > Edward Koryagin Send instant messages to your online friends http://au.messenger.yahoo.com _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
