Article View: comp.os.ms-windows.programmer.tools.mfc
Article #76Re: Linked Lists
From: Tom Vilot
Date: Wed, 10 Apr 1996 00:20
Date: Wed, 10 Apr 1996 00:20
42 lines
2013 bytes
2013 bytes
Blake Kadatz wrote:
>> I would like to store all the objects in a linked list for a given window.
>Have you tried CObList or CPtrList?
These are some of the really nice parts of VC++/MFC.
John, I'd recommend that you read up on these, and all their
permutations (CMapStringToOb, CMapWordToOb, CMapWordToPtr, or whatever
else there is...). They essentially implement linked lists and hash
tables for you. Very sleek. Very easy to use. Very nice.
These list-based objects, as Blake indicated, do not do all kinds of
"automatic" memory allocation/deallocation for you - but you *could*
subclass one of them, or you could write your own object which
utilizes one of these lists within itself, and does all the list
access and memory management for you.
>> ...and return the pointer to the subclass that is allocating the objects
>> on the linked list.
I'm not entirely clear on what you mean here. Do you mean something
like this?:
void CSomeObject::MakeNewListMember(CLinkedList *list)
{
CMyObject *object = new CMyObject;
CNewObject *newObject = object->MakeANewGuy();
list->AddToTail(newObject);
}
??
+---------------------------------------------------------------+
| Thomas J. Vilot || Digital Artist |
| Boulder, Colorado || Multimedia Developer |
| Photographer |
| <href="http://www.indra.com/~tjv/"> |
+---------------------------------------------------------------+
Technical Details
Message-ID:
<DpME74.2uF.0.server@indra.com>Path:
arc1-ca.pugleaf.net!indra.com!usenetReferences:
<4k2kom$k5r@news2.cts.com> <31667AC8.4EE2@mindlink.bc.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++ Path: arc1-ca.pugleaf.net!indra.com!usenet From: tjv@indra.com (Tom Vilot) Subject: Re: Linked Lists Message-ID: <DpME74.2uF.0.server@indra.com> Sender: usenet@indra.com (System Operator) Organization: Indra's Net, Inc. Date: Wed, 10 Apr 1996 00:20:14 GMT References: <4k2kom$k5r@news2.cts.com> <31667AC8.4EE2@mindlink.bc.ca> X-Newsreader: Forte Free Agent 1.0.82 X-Nntp-Posting-Host: net.indra.com