Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tank2005

macrumors newbie
Original poster
Apr 24, 2009
4
0
I'm developing Carbon Bundle Application now.

And I'm looking into the way of getting an own file path. but, even if the .app file of the ringback application is obtainable, an own .bundle file is unacquirable by the following ways.

Code:
ProcessSerialNumber currentProcess = {0, kCurrentProcess};
GetProcessBundleLocation(&currentProcess, &fsRef);

If there is optimal way, please let me know.
 
Try using CFBundleGetBundleWithIdentifier() to get your plugin's bundle, then any of the CFBundle functions can be used to get a file, such as CFBundleCopyResourceURL().
 
I have obtained it by the following code. Many thanks!

Code:
CFBundleRef r1 = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.myplugin"));
CFURLRef u1 = CFBundleCopyBundleURL(r1);
CFStringRef p1 = CFURLCopyFileSystemPath(u1, kCFURLPOSIXPathStyle);

CFRelease(p1);
CFRelease(u1);
CFRelease(r1);
 
Just one more thing: the value returned by CFBundleGetBundleWithIdentifier() shouldn't be released because it follows the Get Rule.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.