Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!ncar!boulder!sunybcs!rutgers!mit-eddie!bbn!bbn.com!levin
From: levin@bbn.com (Joel B Levin)
Newsgroups: comp.sys.mac
Subject: Re: Resource file HELP
Message-ID: <29813@bbn.COM>
Date: 19 Sep 88 14:26:46 GMT
References: 
Sender: news@bbn.COM
Reply-To: levin@BBN.COM (Joel B Levin)
Organization: BBN Communications Corporation
Lines: 17

In article  sn0v+@andrew.cmu.edu (Shoichi Nakai) writes:
(I am a novice C programmer and am writing my first C program for the
(Macintosh.  What this is going to do is to read a text from a resource
(file and to display it in a window.  I got a window created successfully,
(but I couldn't get a right text in a window instead I got a garbage.
( . . .
(   hte = GetIndResource((ResType)"TEXT", (int)256);
( . . .
(According to the debugger, after calling GetIndResource, hte still
(pointed to 0x000000. . . .

Try . . . (ResType)'TEXT' . . .  in the above line, using single
quotes.  "TEXT" gives a pointer to a string; 'TEXT' gives the four
ascii characters in a long, which is what you need.

	/JBL
UUCP:     {backbone}!bbn!levin		POTS: (617) 873-3463
INTERNET: levin@bbn.com