Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!sdd.hp.com!uakari.primate.wisc.edu!ames!vsi1!daver!kcdev!genco!rad From: rad@genco.bungi.com (Bob Daniel) Newsgroups: comp.sys.mac.programmer Subject: Re: Dialog problems in DA Message-ID: <178@genco.bungi.com> Date: 4 Jan 91 16:46:39 GMT References: <4927@tellab5.tellabs.com> Reply-To: rad@genco.bungi.com (Bob Daniel) Organization: Gentry & Assoc. Excelsior Springs, MO Lines: 22 In article <4927@tellab5.tellabs.com> kenk@sunHd.tellabs.com (Ken Konecki) writes: >I'm having trouble getting dialogs to work inside of a desk accessory. I >keep the item list as an owned resource and do a GetResource() call to get >a handle to it. When I create the dialog, I use NewDialog() and pass the >handle of the item list obtained from GetResource() as the item list >parameter. I do the dialogging and then call CloseDialog() at the end of >the routine. Everything works as I expect it to but only on the first time >I bring up the dialog. The second time I try, I get an address error and >get dropped into Macsbug. Stepping through the routine with Macsbug, I've >found that the call to NewDialog() returns a valid dialog record, but the >checkItems() (code deleted) First of all, you will probably want to use a DLOG resource and load that. Second, you should do a GetPort(&savePort) before a modal dialog and SetPort(savePort) after any modal dialog. I just deleted the code, but did you setup globals within you filter? In DA's, you need to setup and restore globals within the filter proc (atleast in Think Pascal you do). _________ moof moof