Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!munnari.oz.au!murdu!ucsvc.ucs.unimelb.edu.au!wehi!jon From: JON@wehi.dn.mu.oz (Jon Eaves) Newsgroups: comp.sys.mac.programmer,aus.mac Subject: Danger Will Robinson, traps for young player. Message-ID: <11591@wehi.dn.mu.oz> Date: 19 Aug 90 20:11:28 GMT Organization: The Azeroth Home for Retired Musicians. Lines: 34 G'day People, I have found an interesting little problem with programming in C. I have found a cure, but I would like to know the 'sanctioned' way to get around this problem. I want to extract the UserName from the Chooser. No problems, just use tempHandle = GetString(CHOOSERNAME), then how do I get the "string" from the tempHandle. The process I was using was strcpy(tempString,PtoCstr((char *)(*tempHandle)); Great, this sets tempString correctly. BUT, the Chooser Name field gets mangled because the resource handle is now in 'C' string format. When the application exits, the resource map is saved and the System becomes unstable (Got the 'Cant Load the Finder', bomb !!) Now some questions. 1) Why the hell is the handle to the resource attached to that resource? Doesn't it make some sort of copy? At no stage do I explicitly use ChangedResource(tempHandle);WriteResource(tempHandle); Why is it saved then? My understanding from IM is that resources will not get saved unless you explicitly use the above process. 2) What is the best way to extract stuff from 'tempHandle' so that things like that don't happen? I presume there is a nice 'safe' way of doing this. aTdHvAaNnKcSe.... -------------------------------------------------------------------------------- Jon Eaves "Quim, don't you ever try to teach me about good and evil. I've been there and you've seen nothing but the map" - Novinha. ACSnet ( jon@wehi.dn.mu.oz ) UUCP ( uunet!munnari!wehi.dn.mu.oz!jon ) Internet ( jon%wehi.dn.mu.oz@uunet.uu.net ) --------------------------------------------------------------------------------