Path: utzoo!mnetor!tmsoft!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: VBL Tasks and Inits Message-ID: <6669@hoptoad.uucp> Date: 4 Mar 89 14:01:25 GMT References: <4646@hubcap.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 19 In article <4646@hubcap.UUCP> mikeoro@hubcap.UUCP (Michael K O'Rourke) writes: >Does anyone have example init source that installs a VBL Task??? > >The discussion of it in IM seems simple, but whatever i do, it seems to either >crash the machine on bootup or else do nothing at all. I'll probably post my >present code for ya'll to rip apart in a couple days if i an't figure anything >else out. The usual problem in this case is that you are just installing a pointer to a routine in your INIT resource. The INIT resource goes away when the system is finished running the INIT, so the VBL task pointer goes off into weirdspace and dies. The way to do this is to put the task in a separate locked code resource in the system heap, and call DetachResource on that code resource from your INIT so it will stick around after the INIT file is closed. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "There are no Famous People on the net. Only some of us with bigger mouths than others." -- Dan'l Danehy-Oakes, The Roach