CFBundleRef for a dylib?
CFBundleRef for a dylib?
- Subject: CFBundleRef for a dylib?
- From: Alfred Van Hoek <email@hidden>
- Date: Mon, 17 Oct 2005 11:12:50 -0400
What are the requirements to obtain a CFBundleRef for a dylib?
The following code:
#if TARGET_RT_MAC_MACHO
Boolean _LoadFrameWorkBundle(FSRef framework, CFBundleRef *dylib)
{
CFURLRef bundleURL = NULL;
CFBundleRef myBundle;
OSErr err = coreFoundationUnknownErr;
bundleURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault,
&framework);
if (bundleURL == nil) {
err = coreFoundationUnknownErr;
}
if (err == noErr) {
myBundle = CFBundleCreate(kCFAllocatorSystemDefault, bundleURL);
if (myBundle == nil) {
err = coreFoundationUnknownErr;
}
}
if ( myBundle != NULL ) {
Boolean ok = CFBundleLoadExecutable( myBundle ); // Try to load
the executable from my bundle.
}
// Clean up.
if (bundleURL != nil) {
CFRelease(bundleURL);
}
*dylib = myBundle;
return (err == noErr);
}
#endif
will work for QuickTime.plugin or other packages, but not if the FSRef
represents a .dylib. The dylib is not a package, the bundleURL contains
the name "myLib.dylib".
What's the correct protocol?
Alfred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden