Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / May 2006



Tip: Looking for answers? Try searching our database.

bundle's resources no longer found

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard - 30 May 2006 18:26 GMT
HI all,

   I've recently updated a component (an audio plug-in) to compile under
XCode on the new IntelMac machine.  The resulting bundle looks just like the
version I have on my PPC Mac (as far as bundle structure and names are
concerned, at least).  But when the plug-in runs, it fails to find its
resources.

   The call Get1Resource('DLOG',1) returns a NULL handle.  I'm not sure why
this would happen.  I've got a .rsrc file in the Resources sub-folder, which
has the same name as the executable (with the ".rsrc" added, naturally),
just like on my PPC-Mac.  So why wouldn't this version see the resources?

   I _suppose_ that the host may be behaving differently, so that I need to
open the resource file myself?  If that's the case, anyone know how I can
test that, and open my own app's resource file?  I'm not familiar with the
steps a bundle app needs to take to open its own resource file from the
Resources folder.  (Probably using FSOpenResFile, but how would I build the
FSRef?  I can't hardcode a path, because the user could move the bundle
anywhere, theoretically.)

Thanks for any clues...

-Howard
simmer26@yahoo.com - 30 May 2006 20:38 GMT
> I'm not familiar with the
> steps a bundle app needs to take to open its own resource file from the
> Resources folder.  (Probably using FSOpenResFile, but how would I build the
> FSRef?

1. Call CFBundleGetMainBundle() to get the application bundle.
2. Call CFBundleCopyResourceURL() to locate the resource file in the
bundle.
3. Call CFURLGetFSRef() to create the FSRef.

>From there you can call FSOpenResFile() and make the Resource Manager
function calls to read the data from the resource.

Mark Szymczyk
Author, Xcode Tools Sensei
http://www.meandmark.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.