Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!usc!oxy!sonenbli
From: sonenbli@oxy.edu (Andrew D. Sonenblick)
Newsgroups: comp.sys.mac.programmer
Subject: simple init not working....
Message-ID: <50963@tiger.oxy.edu>
Date: 1 Oct 89 19:33:14 GMT
Distribution: usa
Organization: Occidental College, Los Angeles, CA  90041
Lines: 29


      Why doen't this INIT work?  It crashes when it gets to the
      SysBeep() call.

      pascal void myBeep(duration)
      int duration;
      {
	   Rect myRect;

	   SetRect(&myRect,0,0,512,342);
	   InvertRect(&myRect);
	   InvertRect(&myRect);
      }

      main()
      {
	   Handle myHandle;

	   myHandle = RecoverHandle((ProcPtr)myBeep);
	   HLock(myHandle);
	   NSetTrapAddress((ProcPtr)myBeep,0xA9C8,OSTrap);
	   SysBeep(8);

      }

      Other variations of this have gotten past the first SysBeep, inverting
the "startup" screen.  However, any further SysBeep call freezes the Mac.
Anyone know what's going (or not going) on?  Please reply to: sonenbli@oxy.edu
Thank ye, thank ye, thank ye, the turkey's in the mail.....