Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!apple!well!gurgle From: gurgle@well.sf.ca.us (Pete Gontier) Newsgroups: comp.sys.mac.programmer Subject: Re: Adding MENU generates "Unexpected error 69320382, [SORRY]" Message-ID: <22935@well.sf.ca.us> Date: 30 Jan 91 04:07:36 GMT References: <1991Jan26.210319.3409@midway.uchicago.edu> Organization: cellular Lines: 53 In article <1991Jan26.210319.3409@midway.uchicago.edu> martin@cs.uchicago.edu writes: >For some reason Hypercard (also Microsoft Word) doesn't like the MENU >that I'm adding from my INIT/DRVR: > >The INIT that does an OpenDeskAcc. In the open routine of the DRVR, I >do (abbreviated): > > PEA -4(A5) > _InitGraf > InitFonts; > GetMenu > DetachResource Whoa there! You don't need to do an _InitGraf in a DA! And if you do find a reason to do it, certainly don't do it relative to A5, because you're likely to trash your host application's QuickDraw. If you really need to do it (and you probably don't), make sure you have your own space for QuickDraw globals and send THAT to _InitGraf. Now, about this DetachResource business: why? The Menu Manager is perfectly happy with a resource handle. I've never bothered to detach a menu resource, and although I can't think of anything specifically wrong with it offhand, I think I would err on the conservative side. Finally, re: MS Word and HyperCard, good luck. They've always been notorious as rule breakers. >I head patch DrawMenuBar: > DeleteMenu > InsertMenu > JMP >Etc. This succesfully adds the MENU to the menubar and selecting from >it seems to correctly enter the Control of the DRVR. At least with >TeachText; HyperCard dies with the interesting ALRT box: > Unexpected error 69320382 [SORRY] >Microsoft Word just dies with an odd address error. >Is this a brain-damaged way to add the menu to every menubar? What's >happening? All help appreciated. Charles, IMHO, don't be patchin' traps from DA's. DA's are ugly enough at this late stage of the game without trap patches. But, to address your question, use the activate event that the Desk Manager sends you to decide when to insert and delete your menu. Much safer, and has the advantage of being documented practice. -- Pete Gontier, gurgle@well.sf.ca.us Software Imagineer, Kiwi Software, Inc.