Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / September 2004



Tip: Looking for answers? Try searching our database.

CALL_ON_LOAD, CALL_ON_MODULE_BIND, etc.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ki Suk Hahn - 27 Sep 2004 16:37 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.

If anyone can help it will be appreciated.

Using CW 9.1 on OS X 10.3, XCode 1.1, 10.3.0SDK

I'm trying to create a Mach-O framework that will call initialization
and termination routines when loaded and when terminated.  Some people
have reported success using CALL_ON_UNLOAD but I cannot get my simple
toy Mach-O framework to execute its initialization and termination
routines using CALL_ON_LOAD/CALL_ON_MODULE_BIND and
CALL_ON_UNLOAD/CALL_ON_MODULE_TERM.

The framework source has:

#pragma CALL_ON_LOAD _init //(also tried CALL_ON_MODULE_BIND)

extern void _init()
{
  // init code
}

The framework is linked with dylib1.o (Nov 2003).  

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.

Thanks for any help or advice on this.

Ki Suk Hahn
Ki Suk Hahn - 30 Sep 2004 14:43 GMT
Resolved in a re-posting I did on comp..sys.mac.programmer.codewarrior.

> 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]
>
> Ki Suk Hahn
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.