Professional Web Applications Themes

Carbonizing StripAddress() and Image Resources? - Mac Programming

I'm attempting to update one of our old PPC applications to Carbon so that I can run it on OSX. I'm almost done, but I've run into two snags: 1) There is some Quicktime code that uses a call to StripAddress(). Will the replacement I'm showing below work? //**** OLD CODE compressed_data = NewHandle(max_compressed_size); HLockHi(compressed_data); compressed_data_ptr = StripAddress(*compressed_data); //***** NEW CODE compressed_data = NewHandle(max_compressed_size); HLockHi(compressed_data); compressed_data_ptr = *compressed_data; It compiles ok, but will it work or is it the best replacement? 2) We have PICT files stored in resources that we use for a splash screen. What's a good way ...

  1. #1

    Default Carbonizing StripAddress() and Image Resources?

    I'm attempting to update one of our old PPC applications to Carbon so
    that I can run it on OSX. I'm almost done, but I've run into two snags:


    1) There is some Quicktime code that uses a call to StripAddress().
    Will the replacement I'm showing below work?

    //**** OLD CODE
    compressed_data = NewHandle(max_compressed_size);
    HLockHi(compressed_data);
    compressed_data_ptr = StripAddress(*compressed_data);

    //***** NEW CODE
    compressed_data = NewHandle(max_compressed_size);
    HLockHi(compressed_data);
    compressed_data_ptr = *compressed_data;

    It compiles ok, but will it work or is it the best replacement?


    2) We have PICT files stored in resources that we use for a splash
    screen. What's a good way to store/retrieve images in Carbon?

    Many thanks!

    CT
    Charles Guest

  2. #2

    Default Re: Carbonizing StripAddress() and Image Resources?

    In article <doit.wisc.edu>,
    Charles Thomas <facstaff.wisc.edu> wrote:
     

    The doentation on StripAddress indicates that it's only necessary
    when using the 24-bit Memory Manager, which hasn't been possible for a
    long, long time. Your new code is correct and will work.
     

    Resources are still available, and you can still use them if you want.
    They're somewhat deprecated, but if you're converting a program that
    already uses them I don't see why you should change.
    Michael Guest

  3. #3

    Default Re: Carbonizing StripAddress() and Image Resources?

    In article <doit.wisc.edu>,
    Charles Thomas <facstaff.wisc.edu> wrote:
     

    It will work. The StripAddress() call was for solving a long vanished
    Macintosh 68000-era compatibility problem.
     

    PICT files stored in resources still work. If you care about file
    systems that don't support resource forks, the system now supports
    resource-fork-format data in the data fork, and you can use a .r file to
    grab resource from an old-style resource file when generating a new one.
    David Guest

  4. #4

    Default Re: Carbonizing StripAddress() and Image Resources?

    In article <doit.wisc.edu>,
    Charles Thomas <facstaff.wisc.edu> wrote:
     

    That's usually what you do, and it will work (as long as your code
    doesn't use the high six bits of addresses for any of its own nefarious
    purposes, of course).
     

    You can keep the PICT resources. They'll keep working just fine, and
    Project Builder will by default copy them into a data fork resource file
    in your application bundle, which will make it safe for use even on UFS
    volumes.

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
    Uli Guest

Similar Threads

  1. image resources
    By Jon Paal in forum ASP.NET Building Controls
    Replies: 9
    Last Post: September 18th, 04:41 PM
  2. web resources
    By twopeak in forum ASP
    Replies: 4
    Last Post: August 22nd, 01:12 AM

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