Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!davidj From: davidj@cbmvax.commodore.com (David N. Junod) Newsgroups: comp.sys.amiga.programmer Subject: Re: What the #&%@? Message-ID: <19559@cbmvax.commodore.com> Date: 6 Mar 91 14:11:42 GMT References: <7823@crash.cts.com> Reply-To: davidj@cbmvax.commodore.com (David N. Junod) Organization: Commodore, West Chester, PA Lines: 21 In article <7823@crash.cts.com> lkoop@pnet01.cts.com (Lamonte Koop) writes: > >I have come face to face with a rather perplexing problem involving a project >I am currently working on, to which I cannot find the answer. I'm hoping > >while(keepgoing) { > Wait(1L << BenchWindow->UserPort->mp_SigBit); > while((msg = (struct IntuiMessage *)GetMsg(BenchWindow->UserPort))) { > code = msg->Code; class = msg->Class; > gad = ((struct Gadget *)msg->IAddress)->GadgetID; You can not assume that IntuiMessage->IAddress is always a gadget! You're referencing 'random' memory. Only pull the GadgetID on GADGETDOWN and GADGETUP events. > LaMonte Koop > Internet: lkoop@pnet01.cts.com ARPA: crash!pnet01!lkoop@nosc.mil > UUCP: {hplabs!hp-sdd ucsd nosc}!crash!pnet01!lkoop > "It's a dog-eat-dog world...and I'm wearing Milk Bone underwear"--Norm ~DNJ~