Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!jason From: jason@ux1.cso.uiuc.edu (Jason) Newsgroups: comp.sys.mac.programmer Subject: Re: How Can I install a VBL Task from an INIT? Message-ID: <1990Sep6.182348.567@ux1.cso.uiuc.edu> Date: 6 Sep 90 18:23:48 GMT References: <1900@mountn.dec.com> Organization: University of Illinois at Urbana Lines: 25 domenikos@emass.enet.dec.com (George Domenikos) writes: >I am having problems with installing successfully a VBL Task at INIT time. >It seems that I crash when I do >myVBL.vblAddr := @DoMyVBLStuff; >where myVBL is of type VBLTask >and DoMyVBLStuff is my procedure name containing the code I want to execute >as VBL. Did you lock down the VBL code so that it wouldn't be moved or purged? A good way to accomplish this is to compile the code for DoMyVBLStuff into a resource, say of type 'task'. Your init should: 1) Load the 'task' code using GetResource() 2) move the code to the top of the heap ( MoveHHi() ) 3) HLock the code. 4) Get a pointer to the code using: myVBL.vblAddr = StripAddress( codeHandle^ ); -- | | |====================| | | | Jason Watts | \ |\ |\ \ | (jazzin@uiuc.edu) |