Newsgroups: comp.lang.pascal Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!maytag!watstat.waterloo.edu!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Subject: Re: Overwrite TApplication.Init? Message-ID: <1991Apr12.012228.3581@maytag.waterloo.edu> Sender: news@maytag.waterloo.edu (News Owner) Organization: University of Waterloo References: <11841@j.cc.purdue.edu> Date: Fri, 12 Apr 1991 01:22:28 GMT Lines: 19 In article <11841@j.cc.purdue.edu> zhou@brazil.psych.purdue.edu (Albert Zhou) writes: >It seems that overwriting TApplication.Init is very hazardous. > I have tried to overwrite it in order to get a different background. >Here is the code: > >procedure mine.init; virtual; >begin > Tapplication.init; > write a different background; >end; > >Odd enough, this modification caused the system to be rebooted. I don't think the problem is with TApplication, it's with your override. You should declare mine.init to be a constructor, not a virtual method. Virtual methods can't be called until after the object is constructed. Duncan Murdoch dmurdoch@watstat.waterloo.edu