Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!psuvm.bitnet!dn5 From: DN5@PSUVM.BITNET Newsgroups: comp.sys.mac.programmer Subject: My problems with AddResource Message-ID: <81471DN5@PSUVM> Date: 14 Apr 89 16:24:38 GMT Organization: Penn State University Lines: 36 I am trying to add a resource to a HyperCard stack. I have done this successfully before, but I can't get it to work now. I copied the code from my working version (which still works), but very odd things happen. My XCMD does the following: aMyRecHandle := MyRecHandle (NewHandle (SizeOf (MyRec))); AddResource (Handle (aMyRecHandle), 'Jfmt', 129, ''); SetResAttrs (Handle (aMyRecHandle), resPurgeable); UpdateResFile (CurResFile); ReleaseResource (Handle (aMyRecHandle)); DisposHandle (Handle (aMyRecHandle)); There is also some error checking, and for testing purposes, this routine returns the number of bytes in the handle created (in the result, which equals 100). There are also some error checking statements, put in when the problems started. They have never been invoked. The problem: After I call the XCMD, I check the stack with resEdit. The resource is created, and the stacks resource fork grows by either 124 or 24 bytes (the first oddity). When I get info on the resource, ResEdit claims that it has a length that can run in the millions of bytes. If I delete the resource (with clear), and call the XCMD again, it may have a different length. However, the XCMD has always claimed to make a constant 100 byte handle. I am not even trying to do anything to the handle (like put data in it yet), just trying to get the **** thing created properly. Anybody out there have any ideas?????? Jay, etc... (D. Jay Newman)