Sack Library Documentation
ContentsIndexReferenceHome
Example

This schedules a routine to run at startup. Fill in the routine with the code you want, and it will run at DEFAULT_PRELOAD_PRIORITY which is the number 69. 

 

  
PRELOAD( MyCustomInit )
{
    // do something here (do anything here,
    // without limitations that are imposed by DllMain/LibMain.
}

 

If you wanted a routine which was guaranteed to run before MyCustomInit you might use PRIORITY_PRELOAD whcih allows you to specify a priority.

  
PRIORITY_PRELOAD( MyOtherInit, DEFAULT_PRELOAD_PRIORITY-10 )
{
   // this will run before other things.
}

 

Priorities are listed in deadstart.h and exit_priorities.h. The priorities are treated backwards, so low number startup priorities go first, and higher number shutdown priorities go first. 

 

Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.