Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!accuvax.nwu.edu!gumball!engber From: engber@gumball.ils.nwu.edu (Mike Engber) Newsgroups: comp.sys.mac.programmer Subject: TESetText moving LOCKED handles Summary: is this possible? Message-ID: <4334@accuvax.nwu.edu> Date: 24 Feb 90 18:42:07 GMT Sender: news@accuvax.nwu.edu Reply-To: engber@gumball (Mike Engber) Organization: ^ Lines: 27 I'm using THINK C 4.0 and my call to TESetText moves my TEHandle, even though it's been locked. ... TEHandle editHan; TEPtr editPtr; ... editHan = TENew(&textRect,&textRect); MoveHHi(editHan); HLock(editHan); editPtr = *editHan; ... TESetText(textPtr,textLength,editHan); At this point editPtr and *editHan have different values (viewed through the debugger) Restoring editPtr with editPtr = *editHan; right after the call to TESetText fixes things up, but why? I also tried putting an extra call to HLock right before the call to TESetText just in case editHan was somehow getting unlocked - no dice. In summary, when I fix up my code to assume that TESetText will move the handle, it works fine. But according to what I've read, I shouldn't have to do things like this. Is this documented is some Tech Note or something. Please respond via email if possible. -ME