Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!eru!luth!sunic!kth.se!cyklop.nada.kth.se!news From: d88-jwa@dront.nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer,aus.mac Subject: Re: Danger Will Robinson, traps for young player. Message-ID: <1990Aug21.181707.19112@nada.kth.se> Date: 21 Aug 90 18:17:07 GMT References: <11591@wehi.dn.mu.oz> <1990Aug20.143025.2160@eng.umd.edu> Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 21 In article <1990Aug20.143025.2160@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes: >>1) Why the hell is the handle to the resource attached to that resource? Use DetachResource() ! >>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. >strncpy(tempString,((char *)(*tempHandle)) + 1, > (size_t)(*(unsigned char *)(*tempHandle))); >tempString[*(unsigned char *)(*tempHandle)] = '\0'; WARNING ! Lock the handles first !!!!!! (And unlock them after, or, better yet, use HGetState() and HSetState()) What I would do is use HandToHand. h+ Jon W{tte, Stockholm, Sweden, h+@nada.kth.se