I just noticed a potential bug in the code I posted earlier. I should have
added a copy constructor to MyClass. In the original code I'm depending on
the compiler to auto-generate the copy constructor which probably would
not work if MyClass contains pointer members. The auto-generated copy
constructor would just do a bitwise copy of all members, rather than
allocating more memory.
So, I should have added the following line to the MyClass declaration:
MyClass( const MyClass& mci ) { /* copy members */ }
- Jaba
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/