Re: Loading CFM from Mach-o...
Re: Loading CFM from Mach-o...
- Subject: Re: Loading CFM from Mach-o...
- From: Dave Thorup <email@hidden>
- Date: Wed, 21 Jan 2004 09:59:56 -0500
On Jan 21, 2004, at 7:03 AM, p3consulting wrote:
From the doc:
"CFBundle allows you to use a folder hierarchy called a bundle to
organize and locate many types of application resources including
images, sounds, localized strings, and executable code. In Mac OS X,
bundles can also be used by CFM applications to load and execute
functions from Mach-O frameworks. You can use bundles to support
multiple languages or execute your application on multiple operating
environments."
As far as I understand you are trying to do the contrary: load and
execute a CFM code module from a Mach-O application
From the docs:
--------------------
http://developer.apple.com/documentation/CoreFoundation/Conceptual/
CFBundles/Concepts/about.html
In addition to packaging the standard resource types (images, sounds,
and localized character strings, for example) bundles are frequently
used to package code that will be dynamically linked into an
application. Bundles provide functions to dynamically load the code and
search for functions by name. Because Core Foundation is intended to
run on multiple operating systems and CPU architectures, the code
loading API insulates you from having to care about the executable
format of the bundles code. Without bundles, not only do you have to
know what format your executable is in, you also have to use a
different set of programming interfaces to deal with each type of
binary. Fortunately bundles know how to load and link your code on any
of the supported platforms, leaving you free to concentrate on more
important matters.
--------------------
All the research that I've done has shown that you can use the CFBundle
functions to load a CFM shared library. In fact, that's one of the
reasons for the existence of Bundles, to provide an API that "insulates
you from having to care about the executable format of the bundles
code." Take a look at this thread on the matter:
http://cocoa.mamasam.com/COCOADEV/2003/09/2/73675.php
Particularly, look at this response from Douglas Davidson of Apple:
http://cocoa.mamasam.com/COCOADEV/2003/09/2/73690.php
So what I'm doing should be possible and I was hoping that it would be
easy. Hopefully it's just some small little thing that I'm doing
wrong. I could certainly use the Code Fragment Manager's routines to
load the shared library, but using CFBundle looked like it would be a
lot easier.
_____________________________
Dave Thorup
Software Engineer
email@hidden
http://www.kuwan.net
Defaults Manager - The premier editor for Mac OS X's User Defaults /
Preferences database.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.