Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!decwrl!pyramid!ut-sally!seismo!rochester!ur-tut!llad From: llad@ur-tut.UUCP (Dennis Venable) Newsgroups: net.micro.mac Subject: help on pasting PICT's Message-ID: <369@ur-tut.UUCP> Date: Tue, 18-Feb-86 00:01:56 EST Article-I.D.: ur-tut.369 Posted: Tue Feb 18 00:01:56 1986 Date-Received: Wed, 19-Feb-86 07:26:53 EST Distribution: net Organization: Univ. of Rochester Computing Center Lines: 58 This is a request for help with pasting PICT's. I am writing a desk accessory that is about 8k in length. I want to be able to paste a picture into the accessory from desk scrap. My accessory seems to work when in MacWrite, but from Finder it always crashes in the ROM's. I allocate a zero-length handle in the open routine and use that for receiving the picture. When an accPaste event is posted, the accessory reads the PICT from scrap and returns a the handle as expected. However, shortly after I DrawPicture, I call GetFontInfo to return font information. The system always crashes in this call to GetFontInfo in the ROM's with the Finder as the application. The picture I have been testing with is only thirty-five (35) bytes long so I should not be walking on the stack. If I remove the GetFontInfo call, it will crash at some other Quickdraw call, such as EraseRect. If anyone out there can give me a hint as to what I need to do, please do so. Thanks in advance! Code segments are as follows (in Aztec C): ... Picture **picH; ... open() { ... picH = (Picture **)NewHandle(0L); ... } doEvent() { ... case accPaste: fromDeskScrap(); break; ... } fromDeskScrap() { long io,len; io = GetScrap(picH,'PICT',&len); if (io == -102) { noPict(); return; } DrawPicture(picH,&(**picH).picFrame); doOtherStuff(); KillPicture(); } doOtherStuff() { ... GetFontInfo(); ... } Again, thanks for any help you can give! /Dennis L. Venable USENET: ...!rochester!ur-tut!llad