Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!hsdndev!dartvax!Roger.W.Brown From: Roger.W.Brown@dartmouth.edu (Roger W. Brown) Newsgroups: comp.sys.mac.programmer Subject: Re: ?'s about HC 2.0 XCMD Text Edit stuff Message-ID: <1991Mar18.215229.13190@dartvax.dartmouth.edu> Date: 18 Mar 91 21:52:29 GMT References: <4.27CF2777@mmug.edgar.mn.org> Sender: news@dartvax.dartmouth.edu (The News Manager) Organization: Dartmouth College, Hanover, NH Lines: 49 In article <4.27CF2777@mmug.edgar.mn.org> Edward.Blakes.Jr.@f13.n396.z1.mmug.edgar.mn.org (Edward Blakes Jr.) writes: > ******** Here's the code ********************************** > /* other declarations, etc. */ > > TEHandle fieldTE, toTE; /* TE record of field */ > Handle htxt; /* Handle to text */ > StScrpHandle txt_scrap; /* Handle to text style scrap */ > TEHandle tempTE; /* TE handle to temp area for pasting */ > > /* Get params stuff. Nothing fishy here */ > > > /* Get fieldTE of FROM field and TO field */ > > fieldTE = GetFieldTE(paramPtr, TRUE, fromID, 0, NIL); > toTE = GetFieldTE(paramPtr,TRUE,toID,0,NIL); > > /* Select the entire toTE and paste it to a temp TErec */ > TESetSelect(0,32767,toTE); > > /*** HC dies right here ***/ > TECopy (toTE); > TEStylPaste(tempTE); > 1. From the "final Version" fo the extended XCMD interface docs from Apple: "the XCMD should NOT use the TEHandle returned by this callback before adjusting the TEHandle^^.inPort field to point to another grafport." .. because you might draw into the card's port. Maybe you might also bomb?? 2. Have you allocated tempTE somewhere? > Also, does GetFieldTE() return a copy of the TE record or a copy of the handle to the field's TE record? A copy of the whole record; you are instructed to dispose of the handle when you are done. If it was not a handle, the real data would be disposed along with it. Any help? ----------------------------------------------------------------- Roger Brown Roger.W.Brown@dartmouth.edu Courseware Development Dartmouth College, Hanover, NH