On 7/28/05 3:27 PM, Igor Garnov didst favor us with:
> thanks everyone and sorry for being stubborn with my belief that
> &pointer = handle. I missed the keyword stating that handle is
> something more than just a pointer to a pointer. No I seem to get the
> point (-:
The whole point to a Handle is that it gives you a reference to a block of
memory that can be relocated. Relocated means, of course, that a new block
will be allocated and the contents of the old block copied before releasing
the new block. In order to do that, the Memory Manager needs to manage the
memory allocations, which isn't possible if you just pass a pointer to a
pointer, and in fact, the memory pointed to by a pointer to a pointer
doesn't even have to be on the heap.
>> What data are you storing? The only way to get the data you can use in an
>> AliasHandle is to use one of the NewAlias APIs. Have you stored data from an
>> AliasHandle in your preferences or some such thing?
>
> Exactly, I store the alias data in my preferences. Later I am trying to
> recover the initial file by giving the stored data to ResolveAlias
> function.
Then you use
alias = (AliasHandle) NewHandle( dataSize );
bcopy( ptrToData, *alias, dataSize );
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden