> I am able to get the _init() to run by putting it in the "Init Entry
> Point" in the target settings, but would like to use the CALL_ON_*
> since I have a termination routine to call as well.
What you see is a Mac OS X design restriction: frameworks (dylibs) are
loaded automatically and they can not be unloaded, so (...) there is no
termination routine. Bundles and loadable bundle packages can be loaded
and unloaded manually and they do have termination routines. They are
the best choice for plugins (if that is what you want).
Regards,
Adriaan van Os
>I've searched the newsgroup for threads related to CALL_ON_LOAD,
>CALL_ON_MODULE_BIND, etc. but have not found an answer to my question.
[quoted text clipped - 9 lines]
>routines using CALL_ON_LOAD/CALL_ON_MODULE_BIND and
>CALL_ON_UNLOAD/CALL_ON_MODULE_TERM.
All I know is the pragmas
#pragma CALL_ON_MODULE_BIND <init_function>
#pragma CALL_ON_LOAD <init_function>
This pragma applies to MacOS X Mach-O only. Specifies that init_function
shuld be called when the dynamic library or bundle is loaded.
#pragma CALL_ON_MODULE_TERM <term_function>
#pragma CALL_ON_UNLOAD <term_function>
This pragma applies to MacOS X Mach-O only. Specifies that term_function
shuld be called just before the dynamic library or bundle is unloaded.
Other than that, you might try upgrading to CW 9.3 and see if that
makes a difference. More than that I'd need to know more.
Ron
>The framework source has:
>
[quoted text clipped - 10 lines]
>Point" in the target settings, but would like to use the CALL_ON_*
>since I have a termination routine to call as well.

Signature
Metrowerks Community Forum is a free online resource for developers
to discuss CodeWarrior topics with other users and Metrowerks' staff
-- http://www.metrowerks.com/community --
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com
Ki Suk Hahn - 30 Sep 2004 14:41 GMT
> >I've searched the newsgroup for threads related to CALL_ON_LOAD,
> >CALL_ON_MODULE_BIND, etc. but have not found an answer to my question.
[quoted text clipped - 28 lines]
>
> Ron
To Ron and Adriaan,
Thanks for your replies. A colleage at work suggested putting the
pragmas after the function definitions, and that worked. (I used
CALL_ON_MODULE _BIND).
Sorry I wasn't more specific about whether I was making a plug-in or
whether I was using Mach-O, etc.
Ki Suk Hahn