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