Deriving classes from CObject in ClassView (and other problems)
I have been using the ClassView abilities of VC++ 6.0a for a little time
now, and they are extremely useful for constructing the framework of
user-classes which I use for data storage etc. However there are some
obvious shortfalls or omissions and I wonder if its possible to rectify any
of them by-hand.
a) As stated in the documentation, CObject is the root for all but a meagre
few MFC classes, and is ideal as a base-class for user-classes.
Unfortunately, when I create a new class using ClassView, there is no
mention of it in the dropdown list if I select MFC Class, and if I select
Generic class and add it as a base class, it complains that it cannot find
the header files for CObject and that I will have to add them manually.
Is there any file I can amend, or anything I can do to rectify this strange
gap in the ClassWizard's knowledge, since it is a strange omission,
considering the usefulness of the class.
b) Has anyone created a Sorted, Unique Entry, Collection. CMap is the
closest I have found, but that is not sorted apparently, and anyway, The key
criteria is in the item/value to be stored, I don't want it as a separate
key as well. Thats just inefficient.
CList and CArray are ordered according to insertion, but they do not even
attempt to enforce uniqueness.
c) Has anyone else had trouble using the 'Add new function...' in the
ClassView/Wizard to add operators, or templatized member functions?
d) Creating template classes directly into a file seems to work ok, but
suddenly you get a Globals Folder in the ClassView, which apparently
contains something (+ beside it), and yet you can't open it. Close the
Workspace, and reopen it, and the Globals folder has vanished.
Thanks for taking the trouble to read through my ramblings, and thank you in
advance for any light you can shed on any of these problems.
(Responses on the newsgroup fine, but would appreciate any code examples to
be duplicated to my Email address)