Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ukma!xanth!nic.MR.NET!srcsip!manyjars!mnkonar From: mnkonar@manyjars.SRC.Honeywell.COM (Murat N. Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: Installing a CODE as a VBL Message-ID: <22489@srcsip.UUCP> Date: 24 May 89 16:20:25 GMT References: <5586@hubcap.clemson.edu> Sender: news@src.honeywell.COM Reply-To: mnkonar@src.honeywell.com (Murat N. Konar) Organization: ipd Lines: 28 In article <5586@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: >I am trying to install a precompiled LSP unit as a VBL task. I compiled it >as a CODE resource and all it does is a sysbeep(1). > >In the calling program i declare: >HCode : Handle; >HCode := GetResource('OUR ',100); { the type and number of the code rsrc} >DetachResource(HCode); >then i set the vblAddr field of the vblTask to be ProcPtr(HCode^). >This crashes the machine every time. What's up? You gotta lock that baby down! SysBeep is listed as a routine that may move or purge memory. So what could be happening is that either your CODE resource is moved by the SysBeep call itself or as a result of other code and your pointer is no longer valid or when SysBeep returns it returns to an area that is no longer your code resoure. Good Luck! ____________________________________________________________________ Have a day. :^| Murat N. Konar Honeywell Systems & Research Center, Camden, MN mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)