Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!sdd.hp.com!decwrl!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: Help, writing resource Message-ID: <0B010004.zjwmag@outpost.UUCP> Date: 31 Jan 91 17:53:51 GMT Reply-To: peirce@outpost.UUCP Organization: Peirce Software Lines: 29 X-Mailer: uAccess - Mac Release: 1.0.3 In article <1115@vtserf.cc.vt.edu>, slavin@GroupW.cns.vt.edu (Scott Slavin) writes: > > I need help rewriting a resource to my application file. > > I have a Dialog box that has data in it. I need to get > that data into the resource fork as resType 'XXXX' and > resID 1003. > I know how to get the data into a Str255 but I don't know > where to go from there. The following code fragment assumes that the resource already exists and you are just updating it... tHandle := GetResource('Data',kDataRsrcID); DataHandle(tHandle)^^ := myData; ChangedResource(tHandle); IF ResError <> noErr THEN SysBeep(5); WriteResource(tHandle); IF ResError <> noErr THEN SysBeep(5); -- michael -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE