Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!ut-emx!chrisj
From: chrisj@ut-emx.UUCP (Chris Johnson)
Newsgroups: comp.sys.mac
Subject: Re: Resource file HELP
Message-ID: <6153@ut-emx.UUCP>
Date: 19 Sep 88 18:32:19 GMT
References: 
Reply-To: chrisj@emx.UUCP (Chris Johnson)
Organization: U.T. Austin Computation Center
Lines: 36

A big part of your problem is that you're using GetIndResource() instead of
GetResource(), which, I suspect, is really what you had in mind.  
GetIndResource('TEXT', 256) will attempt to get the 256th resource of type
text in your resource file.  GetResource('TEXT', 256) will simply attempt
to get a resource of type 'TEXT' whose ID is 256.

Also, if all you want to do is display some text in a window, you may find it
easier to use the TextBox() procedure.

The following source should work, assuming that the window you want to draw 
into is visible and is also the current port.

Handle 				TextHand;
long				TextSize;

TextHand = GetResource('TEXT', 256);
if (TextHand != noErr) {

	LoadResource(TextHand);
	if (ResErr == noErr) {
		
		TextSize = GetHandleSize(TextHand);
		if (MemErr == noErr) {
		
			HLock(TextHand);
		
			TextBox(*TextHand, TextSize, &view_rect, teJustLeft);
			
			HUnlock(TextHand);
		}
	}
}

Hope this helps.

----Chris