Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: XFCN/XCMD string in LSC C v3.0 Message-ID: <6995@hoptoad.uucp> Date: 14 Apr 89 05:37:28 GMT References: <6944@hoptoad.uucp> <2784@pegasus.ATT.COM> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 22 In article <2784@pegasus.ATT.COM> ech@pegasus.ATT.COM (Edward C Horvath) writes: >If all you develop are applications, which own all resource IDs from >128 through 2^15-1, or DRVRs (each which owns 32 IDs of every conceivable >resource) or one of the other "blessed" code types, this is a reasonable >approach. What STR and STR# resource IDs should an XCMD use? Or should >I use GetNamedResource and HOPE nobody else uses a STR# named "godzilla"? Very interesting point. How about just saying that you use the same resource id as the XCMD uses? The programmer ought to be able to find some suitable ID for both an XCMD and a STR# (and you shouldn't need more than one of the latter). The XCMD can discover its own id by getting a pointer to its first address (either the address of the entry point routine, or the A0 that the default LSC header passes you), doing a RecoverHandle, then doing a GetResInfo. If you use GetNamedResource, you're back to using strings in your code -- while you're still easier to internationalize, the technical problems with strings in code resources remain. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "The government of the United States is not, in any sense, founded on the Christian religion." -- George Washington