Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-ses!hpcea!hpausla!jcl From: jcl@hpausla.HP.COM (Jeff Laing) Newsgroups: comp.sys.mac.programmer Subject: Re: Re: A plea for help (double-clicking disabled in Finder...) Message-ID: <2580016@hpausla.HP.COM> Date: 6 Feb 89 22:21:57 GMT References: <379@lclark.UUCP> Organization: HP Australian Software Operation Lines: 39 David W. Berry (dwb@Apple.COM) writes in comp.sys.mac.programmer: ! In article <2580011@hpausla.HP.COM> jcl@hpausla.HP.COM (Jeff Laing) writes: ! > [ my example program deleted from sheer modesty 8-) ] ! ! Something that I don't believe is very explicitly spelled out ! in Inside Mac, although it is mentioned several times is that you really ! do want to restore the previous lock state. Most times your code should ! look like: ! short state = HGetState(handle); ! HLock(handle); ! ... ! HSetState(handle, state); ! ! That way you get to make sure it's locked and at the same time don't destroy ! anybody else's notion that it's locked. Good in theory, but unfortunately HGetState isn't in the Inside Macintosh that I use (the old phone book). This raises another issue. In an attempt to remain compatible with all those 'little brother' Macintoshes (you know, back before we all had less than 1 meg), I have been trying to avoid using these newer traps as much as possible. Of course, every so often you don't have a choice, and have to use (GetTrapAddress() != Unimplemented), and perform a fiddle (as David Oster has pointed out previously). Also, I hate the look of my program(s) that have to rush around ensuring that all the services that they might call are actually there at startup. Especially as the list seems to be growing as an attempt to be robust. Is there a(n accurate) list of new traps and the System/Finder combination that they arrived with? That way, you can stand a chance of telling people that 'this program requires at least System 3.2x to run' I can't afford to keep a copy of every System/Finder around on diskette, even if I could actually find them ... Similiarly, I know that Lightspeed C generates inline HGetState() traps which means I have to write glue to wrap around it to be safe on old Macs; has any one sat down and written their own GluedMacTraps that sits over MacTraps somehow and hides all those incorrect traps? Is it even possible?