Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ResolveAlias leads to crash




On Jul 28, 2005, at 9:36 AM, Steve Mills wrote:

Otherwise, what can I do to create a valid alias handle with the data I store internally?


AliasHandle alias = (AliasHandle)NewHandle(sizeOfYourData);

HLock((Handle)alias);
BlockMove(yourData, *alias, sizeOfYourData);
HUnlock((Handle)alias);

Or use PtrToHand:

AliasHandle alias;
OSStatus err = PtrToHand( yourData, (Handle*) &alias, sizeOfYourData );

(By the way, the HLock and HUnlock in the above code are unnecessary, even on classic Mac OS. BlockMove doesn't cause handle relocation.)

-eric

_______________________________________________
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
References: 
 >ResolveAlias leads to crash (From: Igor Garnov <email@hidden>)
 >Re: ResolveAlias leads to crash (From: Jim Correia <email@hidden>)
 >Re: ResolveAlias leads to crash (From: Igor Garnov <email@hidden>)
 >Re: ResolveAlias leads to crash (From: "Steve Mills" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.