Can I use a Mach-O plugin with a CFM app?

Is there a way to perhaps make a bridge/interpreter between the CFM application and a Mach-O plugin? I know it's possible to get a CFM app to work with a Mach-O plugin but the CFM app has to be built to work that way. I was wondering if it could work by just modifying the Mach-O plugins somehow.


Authored by: Anonymous on Friday, June 04 2004 @ 05:09 PM BST
You can create a bridge layer between CFM and Mach-O. It's not really as
straightforward as one might like, but it is possible.

Essentially what you want to do is create a Mach-O bundle that contains
the code you want to call. Then you create your CFM plugin so that it
loads that bundle using the routines in CFBundle. Once you have loaded
the Mach-O Bundle you can use CFBundleGetFunctionPointerForName to
extract routine pointers from the bundle one at a time. When the system
loads the routine pointers, It will return to you a pointer that can
successfully bridge the gap between CFM and Mach-O.

You would use the same technique if you wanted to call, for example,
routines in the System.framework (i.e. BSD function calls) from a Carbon
application.

Correspondingly, there are examples of how to do this kind of thing in the
CarbonLib 1.6 SDK in the Sample Code folder in a folder called
CFM_MachO_CFM

If you are really, really clever, and if the Maya development environment
will allow one set of CFM code to register many plug-ins, you might be
able to create a generic CFM-Mach-O bridge that will allow you to develop
a host of Mach-O based plugins that all go through a single CFM front-end.
A simliar sort of thing has been used in applications like Macromedia
FreeHand to allow them to continue to support old plugin architectures.