Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!pepe!shane From: shane@pepe.cc.umich.edu (Shane Looker) Newsgroups: comp.sys.mac.programmer Subject: Re: LightSpeed C query (DA with LSC) Message-ID: <509@mailrus.cc.umich.edu> Date: 13 May 88 19:09:08 GMT References: <597@tasis.utas.oz> <0WWkiAy00XcP0GR2Yn@andrew.cmu.edu> Sender: usenet@mailrus.cc.umich.edu Reply-To: shane@pepe.cc.umich.edu (Shane Looker) Organization: University of Michigan Computing Center, Ann Arbor Lines: 21 In article <0WWkiAy00XcP0GR2Yn@andrew.cmu.edu> rs4u+@andrew.cmu.edu (Richard Siegel) writes: > >Because Desk Accessories use A4 as the base for globals, instead of A5, the >QuickDraw globals will not be initialized properly. You should not use >QuickDraw globals from a desk accessory or device driver, for this reason. Here is a semi-related piece of trival about A4. If you have a UserItem in a dialog box the drawing procedure gets called from the ToolBox. When it gets called, A4 is not the same was when you called ModalDialog. This is quite alarming when you need to get at your Globals from inside the procedure, AND you are in a DA (driver). The solution to the problem is to put the value of A4 into the dataHandle of the the dialog box (it may either need to be extended or created), then MODIFY A4 while you are in the procedure, and replace it when you exit. Fun Stuff. Shane Looker shane@pepe.cc.umich.edu uunet!umix!pepe.cc.umich.edu!shane Looker@um.cc.umich.edu