Re: Building a command line tool that calls DotMacKit
Re: Building a command line tool that calls DotMacKit
- Subject: Re: Building a command line tool that calls DotMacKit
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sat, 4 Dec 2004 08:49:36 +0100
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