Frameworks in bundles in apps, oh my (was Re: Building a command line tool that calls DotMacKit)
Frameworks in bundles in apps, oh my (was Re: Building a command line tool that calls DotMacKit)
- Subject: Frameworks in bundles in apps, oh my (was Re: Building a command line tool that calls DotMacKit)
- From: Óscar Morales Vivó <email@hidden>
- Date: Mon, 6 Dec 2004 11:15:00 -0500
Sorry if you get two variants of this message. Mail barfed badly on me
and I believe the first one wasn't sent (nor saved) but I could be
wrong.
Anyway, from what I read in the feedback I got about my previous
question, it seems it's wiser for me to build a Mach-O bundle that
calls dotmackit and exports a number of C functions that can get called
from my CFM app. Fortunately the whole setup only needs to work in
10.3.6 or better. However there's still some things I'd like cleared
before I strike on that path. Namely:
- What's this problem about having frameworks in bundles in apps that I
see mentioned in the message below? Is it still around as of 10.3.6? If
so, how can I go around it?
- What kind of setup/initialization do I need to do in my Mach-O bundle
to call DotMacKit functions apart from setting up an autorelease pool?
A detailed explanation of what and why (or link to it) would be best.
Thanks in advance for your help:
Óscar Morales Vivó.
On Dec 4, 2004, at 02:49 , M. Uli Kusterer wrote:
At 16:45 Uhr -0500 03.12.2004, Óscar Morales Vivó wrote:
I'm trying to build a small command line utility (to be called from
an old CFM program that we definitely can't afford to bring to Mach-O
right now) that will use the DotMacKit to implement a couple new
features for the main app. However I'm running into a couple of setup
problems as follows:
- How can I set up a tool project so it will use a Framework which is
not in the system ones? As the tool is going to reside inside the CFM
application bundle, I'm pretty much free to hardwire the framework
location in relation to the tool, but I still don't know for sure
what to do exactly and how to go about it so it compiles, links and
executes properly.
Oscar,
this sounds like it'd get messy.
Based on what I read on this list, I don't think it's possible to
include a framework with a command-line tool. Only bundled
applications can include frameworks, and everything else has to be in
one of the system paths.
So unless you want to add code to your tool to install a copy of the
framework in a standard location, the only other option besides
compiling the framework's code into your app is likely to build a full
application instead. Build a little Cocoa "helper application" and
launch it using Launch Services, and maybe wait for notification that
your helper app has quit.
If you need to transfer data between the apps, there are various
methods: Apple Events (which are the only thing that works between
Classic and native apps), a Unix pipe (though you'd have to load the
functions needed from the system using CFBundle), etc.
Another option would be to create a Cocoa plugin, but it's rather
complicated (and on some system versions impracticable -- IIRC
anything before 10.2) to load a Cocoa bundle into a Carbon
application. It is, however, quite a bit easier to load a MachO bundle
from a CFM application. (You can use CFBundle for this, but mixing
Cocoa and Carbon isn't supported on pre-10.2, and the function to
initialize a Cocoa app inside an existing Carbon app was only just
added in 10.3).
Also, IIRC it's kinda hairy to include a framework in another
framework (or in a plugin bundle), which means people usually include
the framework with the application instead of the bundle that uses it
-- something related to the @executable_path hack and the lack of an
@framework_path hack to go with it.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden