on 25/01/02 17:06, Mike Shubeck at [EMAIL PROTECTED] wrote:

> The first problem I have run into is how to call functions in the plug-in,
> other then the one at the first offset in the code resource database as
> demonstrated by the PlugIn-1 example.  I tackled this by having the function
> at the first offset or __Startup__ function take a structure of function
> pointers as a parameter.  The function then points the function pointers to
> the corresponding functions in the plug-in.  After the __Startup__ function
> ends, the calling application can call the functions in the function pointer
> structure.  Is there a cleaner / more elegant way of obtaining the plugin's
> function offsets?

Easy. You can customize the name of the entry point in CodeWarrior in the
68K Target preference panel. For one of my software, plug-ins have a
PlugMain function and the entry point goes to PlugMain. It takes a parameter
block pointer as parameter. The first thing the software does after loading
the plugin is call it with a request for function pointer. The PlugMain code
fills the structure with pointers to all the "exported" functions which can
in turn be called from the main application.

Usually, taking the shared library approach is cleaner, even though it's not
as simple (but you will find many examples for this in the docs and on the
net).

-- 
Florent Pillet, Code Segment       [EMAIL PROTECTED]
PGP Key: D13C 6DD7 D0E2 7891 4AF9 0111 9514 4753 02F1 4D6D

PowerGlot, the premier localization tool for Mac OS software
   -> PowerGlot Software           http://www.powerglot.com/
Sync Buddy for Mac & PalmOS. FindHack, SymbolHack for PalmOS
   -> ...and other tools... http://perso.wanadoo.fr/fpillet/
BrainForest, outlines & action items for Palm, Mac & Windows
   ->                                http://www.aportis.com/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to