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: GetGraphicsImporterForDataRef



I think you're misunderstanding the function call. Yes, the parameter says
that you're passing a Handle, but the real determination of what you're
sending is specified by the PointerDataHandlerSubType, or
HandleDataHandlerSubType specification.

If you want to pass in a pointer, I think you could probably just cast the
actual pointer to the data: Something like:

data = [NSData dataWithContentsOfURL:url];
void *dataref = [data bytes];

err = GetGraphicsImporterForDataRef((Handle)dataref,
PointerDataHandlerSubType, &gi);
if (err != noErr)
{
NSLog(@"Can't get graphics import component for data");
goto CLEAN_UP_SELF;
}

This will probably work just fine for you.

Thanks for the help, Scott.

I finally got a chance to try this today, but I crash now with a segmentation fault. At least using an actual handle with a pointer in it only caused an error ;)

Still stumped,
Keith
_______________________________________________
mac-games-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-games-dev
Do not post admin requests to the list. They will be ignored.



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.