Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!lll-winken!cert!netnews.upenn.edu!grad1.cis.upenn.edu!gilbert From: gilbert@grad1.cis.upenn.edu (Michael Gilbert) Newsgroups: comp.sys.mac.programmer Subject: THINK C Help with Resources Keywords: AddResource Message-ID: <30543@netnews.upenn.edu> Date: 4 Oct 90 03:14:54 GMT References: < Sender: news@netnews.upenn.edu Reply-To: gilbert@grad1.cis.upenn.edu.UUCP (Michael Gilbert) Organization: Pennsylversity of Univania Lines: 34 I have a simple problem (well, not to me), which I encountered recently during my slow, but unsteady progress in learning Mac C programming. My problem is in creating a "save file." I have an object pointed-to by a handle, such as: ThingHandle myThingHandle; I want to store this thing as a resource in a file. So, I first call CreateResFile (myFileName); (with appropriate error-checks), and then UseResFile (myFileName) to make use of the file. Finally, I use AddResource ((Handle) myThingHandle ...) to add the resource. Now, using ResEdit, I can see that the resource was indeed added correctly to this file. However, after saving this data to the file and closing it, the data in my object is corrupted. Is there some step I'm missing, possibly involving HandToHand, that would keep the data stable? Any help and code snippets would be appreciated, by posting or e-mail. =============================================================================== | CONSIDER IT DISCLAIMED | #include | |-----------------------------------------------------------------------------| | _ _ _ | Better the pride that resides, | | ' ) ) ) / | In a citizen of the world, | | / / / o /_ _ | Than the pride that divides, | | / ' (_<_/ <_