Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!sics.se!sics!dagr From: dagr@nmpcad.se (Dag Rende) Newsgroups: comp.sys.mac.programmer Subject: Re: GetScrap() not returning string; please help. Message-ID: Date: 20 Mar 91 09:09:47 GMT References: <63295@bbn.BBN.COM> Sender: news@sics.se Distribution: comp Organization: nmp Lines: 9 In-Reply-To: rmitchel@bbn.com's message of 18 Mar 91 12:55:59 GMT You make life hard for the memory manager! The HLock/HUnlock calls must not be used here. Remove them and it will probably work. When you call GetScrap, it tries to resize the handle you supply to fit the data got from the scrap. In your case you allocate a zero length handle. GetScrap must probably grow it. As you HLock it, it must be unused space enough following the handle in the heap. That is not often the case and the memory manager gives up. With an unlocked (relocatable) handle, the memory manager can pack the heap and find a new place for your handle big enough for the scrap data.