Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!lanl!opus!ksitze From: ksitze@nmsu.edu (Kevin Sitze) Newsgroups: comp.sys.mac.programmer Subject: Re: Control Bars Message-ID: Date: 15 May 89 18:47:31 GMT References: <5706@microsoft.UUCP> Sender: news@nmsu.edu Organization: NMSU Computer Science Lines: 46 In-reply-to: peterbak@microsoft.UUCP's message of 12 May 89 16:38:22 GMT Relatively simple... Your call to FindControl: tempInt = FindControl(&MousePoint, myWindow, &whichControl); Should be tempInt = FindControl(MousePoint, myWindow, &whichControl); and accordingly the calls to TrackControl should be: For Thumb: TrackControl(whichControl, MousePoint, nil); For rest: TrackControl(whichControl, MousePoint, MoveScrollbar); A point is 4 bytes long and should be passed directly. A pointer to the point will give the wrong value. Finally, the reason everything blows up in your face: You have to tell C that the routine is expected to be called from the toolbox. E.g. Pascal compatable: pascal MoveScrollbar(theControl, partCode) ControlHandle theControl; int partCode; { } Have fun!! -Kelesi -- ------------------------------------+------------------------------- From the Macintosh of: Kevin Sitze | Disclamer: Who the heck needs | a disclamer? After all, Dan EMail: ksitze%NMSU.edu | Quayle doesn't. SMail: 601 S. Melendres +------------------------------- Las Cruces, NM 88005 | "We have the answers, the ------------------------------------+ trouble lies in finding the "The difference between intelligence| questions..." and stupidity is that intelligence | "The information is there, has a limit." - anonymous | finding it is another story." The dolt confuses you -- more -- | - Any consultant ------------------------------------+-------------------------------