Article View: comp.sys.mac
Article #32272Re: Resource file HELP
From: Chris Johnson
Date: Mon, 19 Sep 1988 20:29
Date: Mon, 19 Sep 1988 20:29
18 lines
1115 bytes
1115 bytes
A brief note on the source I posted.
The line: if (TextHand != noErr) {
Should actually read: if (TextHand != NULL) {
By coincidence, noErr and NULL both equal zero so the example
works anyway, but it isn't really correct. With most resource
manager calls you would check the global ResErr to see if the
call completed properly, but there's a bug in GetResourse() that
permits it to return in noErr even in cases where it was unable to
get a resource, so with GetResource() it's best to check the handle
it returns to see if it is equal to NULL or not. (If it is NULL,
the call failed.)
I was typing faster than I was thinking, sorry.
----Chris
Technical Details
Message-ID:
<6156@ut-emx.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cs.utexas.edu!ut-emx!chrisjReferences:
<MXAyfcy00Xc=MAOEQe@andrew.cmu.edu> <6153@ut-emx.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cs.utexas.edu!ut-emx!chrisj From: chrisj@ut-emx.UUCP (Chris Johnson) Newsgroups: comp.sys.mac Subject: Re: Resource file HELP Message-ID: <6156@ut-emx.UUCP> Date: 19 Sep 88 20:29:57 GMT References: <MXAyfcy00Xc=MAOEQe@andrew.cmu.edu> <6153@ut-emx.UUCP> Reply-To: chrisj@emx.UUCP (Chris Johnson) Organization: U.T. Austin Computation Center Lines: 18