Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!leonardr From: leonardr@uxe.cso.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: Re: INITs and ShutDown routines Message-ID: <226000039@uxe.cso.uiuc.edu> Date: 30 Dec 88 17:59:00 GMT References: <144@radar.UUCP> Lines: 37 Nf-ID: #R:radar.UUCP:144:uxe.cso.uiuc.edu:226000039:000:1865 Nf-From: uxe.cso.uiuc.edu!leonardr Dec 30 11:59:00 1988 buffington@radar.UUCP(Jon Buffington) in comp.sys.mac.programmer >I am interested in writing an INIT which installs a >ShutDown routine. I am using LSC 3.0 on an Mac II. >All I have been able to accomplish so far is to bring >up a PICT to identify what's happening and presumably >install a routine using ShutDwnInstall(). When >the routine is called *blammo* ID=01. I understand >my routine is getting scrapped my the memory munger. >(Oddly, the INIT works sometimes on an SE.) >What I am interested in learning is how to prevent the >vaporization of my code. Below is the INIT so far: > >[Code Follows] What I would recommend is what I did for my ShutDownSound INIT - rather than keeping ALL the code in the INIT resource, actually create two resources - the INIT and another code-type resource (I call mine PROC). This scheme implies that your INIT is simply a loader. It gets the other resource, puts it into the system heap and locks it down. Then it sets it up with ShutDwnInstall. The PROC is the actual code that you want executed at ShutDown time. Much cleaner and easier... If you need some example source, let me know! +---------------------------------+-----------------------------------+ + + Any thing I say may be taken as + + Leonard Rosenthol + fact, then again you might decide+ + President, LazerWare, inc. + that it really isn't, so you + + + never know, do you?? + + leonardr@uxe.cso.uiuc.edu + + + GEnie: MACgician + MacNET: MACgician + + Delphi: MACgician + AppleLink: D0025 + + + + +---------------------------------+-----------------------------------+