Re: Loading CFM from Mach-o...
Re: Loading CFM from Mach-o...
- Subject: Re: Loading CFM from Mach-o...
- From: p3consulting <email@hidden>
- Date: Wed, 21 Jan 2004 17:28:27 +0100
Ok you could do it with a bundle
from what you post, I deduce you write the shlb yourself
so how do you compile it?
CodeWarrior ?
Is your code C or C++ ? you may have problem with namespace in the
later case
how do you have published the list of "external" symbols: the list of
function names to made publically available ?
an easy way to do (and to forget to do) with CW is to add a .exp file
to your project.
Try the CFM API: if it doesn't work, it probably means your function
names are not exported or least not under the name you expected.
Pascal Pochet
P3 Consulting
On 21 janv. 2004, at 15:59, Dave Thorup wrote:
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.
_______________________________________________
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.