Professional Web Applications Themes

resource mgr problem MachO app pkg - Mac Programming

I'm having trouble with AddResource() only in the Mach0 version of my app. The app is an application package built with CW8.3 in C. Here's the code that works in a PPC OS 9 version (outline): UseResFile(gAppResFileNum); <-- gotten at program startup with CurResFile() size = *resourceData; handle = NewHandle(size); BlockMoveData(resourceData + 1, *handle, size); AddResource(handle, resourceType, resourceID, "\p"); AddResource fails with ResError of -61. This works fine in the PPC version. I think I'm not understanding something about application packages and resources. OS 10.2.6 TIA...

  1. #1

    Default resource mgr problem MachO app pkg

    I'm having trouble with AddResource() only in the Mach0 version of my app.
    The app is an application package built with CW8.3 in C.

    Here's the code that works in a PPC OS 9 version (outline):

    UseResFile(gAppResFileNum); <-- gotten at program startup with CurResFile()
    size = *resourceData;
    handle = NewHandle(size);
    BlockMoveData(resourceData + 1, *handle, size);
    AddResource(handle, resourceType, resourceID, "\p");

    AddResource fails with ResError of -61.

    This works fine in the PPC version.
    I think I'm not understanding something about application packages and
    resources.

    OS 10.2.6

    TIA

    brucecoughlin Guest

  2. #2

    Default Re: resource mgr problem MachO app pkg

    In article <BB3F092C.3A91%brucecoughlinnyc.rr.com>,
    brucecoughlin <brucecoughlinnyc.rr.com> wrote:
    > UseResFile(gAppResFileNum); <-- gotten at program startup with CurResFile()
    > size = *resourceData;
    > handle = NewHandle(size);
    > BlockMoveData(resourceData + 1, *handle, size);
    > AddResource(handle, resourceType, resourceID, "\p");
    >
    > AddResource fails with ResError of -61.
    wrPermErr = -61, /*write permissions error*/


    You are writing to your own resource fork. Don't do it. It didn't work on Mac OS
    9, but you never noticed because you never tried running your app from a CD,
    from a file server, using NetBoot, or as a restricted access user under Mac OS 9
    Multiple Users.

    Read <http://developer.apple.com/technotes/tn/tn1151.html>.
    and <http://developer.apple.com/technotes/tn/tn1186.html>
    and then come up with a better way to handle this (I suspect you are trying to
    implement a copy protection scheme).

    meeroh
    Miro Jurisic Guest

  3. #3

    Default Re: resource mgr problem MachO app pkg

    Ok, I figured it out.
    I use CFBundleGetMainBundle()
    and
    CFURLGetFSRef()

    to stash my serial number 'rsrc' file in the app's package.

    >
    >
    >>
    >> wrPermErr = -61, /*write permissions error*/
    >>
    >>
    >> You are writing to your own resource fork. Don't do it. It didn't work on Mac
    >> OS
    >> 9, but you never noticed because you never tried running your app from a CD,
    >> from a file server, using NetBoot, or as a restricted access user under Mac
    >> OS
    >> 9
    >> Multiple Users.
    >
    >
    brucecoughlin Guest

Similar Threads

  1. Operation failed. The resource is not a directory, orthere might be a permission problem
    By Ken Jacobs in forum Macromedia Contribute General Discussion
    Replies: 3
    Last Post: December 5th, 06:34 PM
  2. "Operation Failed. The resource is not a directory, orthere might be a permission problem"
    By rmurdoch in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: June 1st, 02:02 PM
  3. ssl resource
    By Joe in forum ASP.NET Security
    Replies: 0
    Last Post: October 18th, 04:39 AM
  4. "A required resource cannot be loaded" - Problem Solved.
    By mmewhort@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: April 14th, 09:29 AM
  5. Mac projector/resource forks problem?
    By goldtooth in forum Macromedia Director Basics
    Replies: 0
    Last Post: February 18th, 12:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139