home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 19733 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.8 KB  |  38 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!utkux1.utk.edu!utkvx3.utk.edu!egw
  3. From: egw@utkvx3.utk.edu (Wolpert, Edward Greenwal)
  4. Subject: HELP! Asap! GetPort Bus Error problems.
  5. Message-ID: <13DEC199201003128@utkvx3.utk.edu>
  6. News-Software: VAX/VMS VNEWS 1.41    
  7. Sender: usenet@utkux1.utk.edu (USENET News System)
  8. Organization: University of Tennessee Computing Center
  9. Date: Sun, 13 Dec 1992 05:00:00 GMT
  10. Lines: 26
  11.  
  12. Ok, I'm the idiot who attempted to copy bit's by copying the screen rgn.  I 
  13. went off and used different code, but now when I'm opening up a grafptr, I
  14. get a Bus error.  It's from the following (trunkated code):
  15.     GetPort(oldPort);
  16.     bm.RowBytes := winPtr^.portBits.rowBytes;
  17.     SetRect(bm.Bounds, winPtr^.portRect.left, winPtr^.portRect.top,
  18. winPtr^.portRect.right, winPtr^.portRect.bottom);
  19.     bm.baseAddr := NewPtrClear(GetPtrSize(winPtr^.portBits.BaseAddr));
  20.     if bm.baseAddr <> nil then    {}
  21.      begin    {our work}
  22.       openPort(gp);
  23.       SetPortBits(bm);
  24.       BlockMove(@bm.bounds, @gp^.portRect, sizeof(rect));
  25.  
  26. {For those don't have USERNET mac programing guide, this is taken from Glenn
  27. Austin's how to draw to an offscreen bitmap, changed somewhat by me}
  28.     When I have the openPort(gp) command, the mac (sometimes) gives a
  29. bus error via Think, or it just shuts down.  Any ideas?  If it's past sunday
  30. afternoon, eastern time, don't bother.
  31.     SideQuestion:    If I step through the program, Think complains about
  32. the bus error, and I can quit, and restart the mac without problem.  If I
  33. don't quit, and try again, the mac freezes with manual restart being the only
  34. method of getting it back up.  However, if I just run though the program, not
  35. stepping, the computer freezes at that point.  Any ideas why it works that way?
  36.     Edward Wolpert
  37.  
  38.