home *** CD-ROM | disk | FTP | other *** search
- 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
- From: noah@apple.com (Noah Price)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Duplicate Object in Think C?
- Message-ID: <noah-040193100857@noah.apple.com>
- Date: 4 Jan 93 18:14:03 GMT
- References: <white.724729120@sfu.ca> <1992Dec20.160310.28061@eng.umd.edu> <1992Dec20.203018.6764@netcom.com>
- Sender: news@gallant.apple.com
- Followup-To: comp.sys.mac.programmer
- Organization: (not the opinions of) Apple Computer, Inc.
- Lines: 24
-
- In article <1992Dec20.203018.6764@netcom.com>, mspace@netcom.com (Brian
- Hall) wrote:
- >
- > Have you tried newObj = oldObj->Copy(); Copy is a method of the CObject
- > class. It will make a copy of the object, but you may want to override
- > it in subclasses to make sure it makes a copy of the data, and not a copy
- > of the references to data, if that is what you want.
-
- CObject::Copy uses HandToHand to duplicate the whole kit 'n caboodle (sp?).
- They note in the source that objects are just handles, so this should copy
- all the data in the object. If the object contains handles to other data,
- you may need a subclass which knows if you just want the handle copied, or
- if the data it references should be duplicated too. Did we just say the
- same thing? Maybe so... :-)
-
- (hey, I'm glad I read this group... this question just made me think about
- it enought that I may know the cause of a bug I spent at least two days
- chasing last week!)
-
- noah
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- noah@apple.com Macintosh Hardware Design
- ...!{sun,decwrl}!apple!noah (not the opinions of) Apple Computer, Inc.
-