home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!nih-csl.dcrt.nih.gov!FAXCSL!FIXER
- From: fixer@faxcsl.dcrt.nih.gov (Chris Spiral Catfish Tate)
- Subject: Re: Problem isolated but not understood (THINK Pascal standalone crash)
- Message-ID: <1992Nov19.130202.9832@alw.nih.gov>
- Sender: postman@alw.nih.gov (AMDS Postmaster)
- Reply-To: fixer@faxcsl.dcrt.nih.gov
- Organization: Computer Systems Laboratory, DCRT, NIH
- References: <Bxy3q0.231@news.udel.edu>
- Date: Thu, 19 Nov 1992 13:02:02 GMT
- Lines: 38
-
- In article <Bxy3q0.231@news.udel.edu>, kurisuto@chopin.udel.edu
- (Sean J. Crist) writes:
- >
- >SetHandleSize(Handle(DestinationHandle), GetHandleSize
- > (Handle(SourceHandle))); {Make the two handles the same size}
- >BlockMove(Pointer(SourceHandle^), Pointer(DestinationHandle^),
- > GetHandleSize(Handle(SourceHandle))); {Copy the contents
- > of one handle into the other}
-
- This looks suspicious, because there's a Toolbox call within the parameter
- list to the BlockMove() procedure. Does anyone know whether GetHandleSize()
- moves memory? It seems unlikely, but you never know. You could try
-
- (* sourceSize is a LONGINT *)
-
- sourceSize := GetHandleSize(Handle(SourceHandle));
- BlockMove(Pointer(SourceHandle^), Pointer(DestinationHandle^),
- sourceSize);
-
- and see if that helps.
-
- Alternatively, you could just use the HandToHand() OS Utility call, thus:
-
- (* DO NOT allocate DestinationHandle previously! *)
-
- DestinationHandle := SourceHandle;
- err = HandToHand(Handle(DestinationHandle));
-
- This allocates a new handle, copies the contents of the argument block into
- it, and sets the argument to be equal to it, i.e. causes DestinationHandle
- to point to a new copy of what it *used* to point to. You have to remember
- seperately the original handle. See Inside Macintosh II-374 for full details.
-
- ------------------------------------------------------------------------------
- Christopher Tate | The Leadfoot Collection, Continued:
- Management System Designers | * Heavy Fuel (Dire Straits)
- | * Last Scene in September (Preston Reed)
- fixer@faxcsl.dcrt.nih.gov | Because driving fast is a cathartic experience.
-