home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20655 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!cs.utexas.edu!sun-barr!olivea!apple!goofy!mumbo.apple.com!gallant.apple.com!noah.apple.com!user
  2. From: noah@apple.com (Noah Price)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Duplicate Object in Think C?
  5. Message-ID: <noah-040193100857@noah.apple.com>
  6. Date: 4 Jan 93 18:14:03 GMT
  7. References: <white.724729120@sfu.ca> <1992Dec20.160310.28061@eng.umd.edu> <1992Dec20.203018.6764@netcom.com>
  8. Sender: news@gallant.apple.com
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: (not the opinions of) Apple Computer, Inc.
  11. Lines: 24
  12.  
  13. In article <1992Dec20.203018.6764@netcom.com>, mspace@netcom.com (Brian
  14. Hall) wrote:
  15. > Have you tried newObj = oldObj->Copy();  Copy is a method of the CObject
  16. > class.  It will make a copy of the object, but you may want to override
  17. > it in subclasses to make sure it makes a copy of the data, and not a copy
  18. > of the references to data, if that is what you want.
  19.  
  20. CObject::Copy uses HandToHand to duplicate the whole kit 'n caboodle (sp?).
  21.  They note in the source that objects are just handles, so this should copy
  22. all the data in the object.  If the object contains handles to other data,
  23. you may need a subclass which knows if you just want the handle copied, or
  24. if the data it references should be duplicated too.  Did we just say the
  25. same thing?  Maybe so... :-)
  26.  
  27. (hey, I'm glad I read this group... this question just made me think about
  28. it enought that I may know the cause of a bug I spent at least two days
  29. chasing last week!)
  30.  
  31. noah
  32.  
  33. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  34. noah@apple.com                                 Macintosh Hardware Design
  35. ...!{sun,decwrl}!apple!noah   (not the opinions of) Apple Computer, Inc.
  36.