home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- myProg.c
- Sample main program
-
- Copyright 1988 Gregory H. Dow. All Rights Reserved.
- ******************************************************************************/
-
- #include "GlobalVars.h"
- #include "CApplication.h"
- long myAppDispatcher();
-
- main()
- {
- /* Initialize the Mac programming environment. The parameter */
- /* is an int specifying the number of additional master */
- /* pointer blocks to pre-allocate. More master blocks will */
- /* be allocated automatically by the system if they are */
- /* needed. However, such automatic allocation may result in */
- /* heap fragmentation (not a good thing). */
-
- InitEnvironment(2);
-
- /* Create a new application object. Store it in a global */
- /* variable since there may be only one instance of an */
- /* application class. Then initialize it. */
-
- gApplication = (ApplicationObjH) NewObject(sizeof(ApplicationObj),
- myAppDispatcher);
-
- SendMsg(gApplication, msgINITobj);
-
- /* Run application with a */
- /* sleep time of 20 ticks */
- SendMsg(gApplication, msgRUNappl, 20L);
-
- /* Exit the application. Perform clean up actions and save */
- /* desired program status information. */
-
- SendMsg(gApplication, msgEXITappl);
- }