Click here to Skip to main content
15,915,172 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get the "Internet Explorer_TridentCmboBx" element handler Pin
TAUHIDUL ISLAM31-Dec-03 20:21
TAUHIDUL ISLAM31-Dec-03 20:21 
GeneralVC++ 6.0 and XP Pin
pranavamhari31-Dec-03 20:17
pranavamhari31-Dec-03 20:17 
GeneralRe: VC++ 6.0 and XP Pin
Michael Dunn31-Dec-03 20:20
sitebuilderMichael Dunn31-Dec-03 20:20 
GeneralRe: VC++ 6.0 and XP Pin
pranavamhari31-Dec-03 20:44
pranavamhari31-Dec-03 20:44 
GeneralFrom MTA to STA Pin
Prakash Nadar31-Dec-03 18:40
Prakash Nadar31-Dec-03 18:40 
GeneralRe: From MTA to STA Pin
Michael Dunn31-Dec-03 20:19
sitebuilderMichael Dunn31-Dec-03 20:19 
GeneralRe: From MTA to STA Pin
Prakash Nadar1-Jan-04 16:07
Prakash Nadar1-Jan-04 16:07 
GeneralA Doubt Pin
Rane31-Dec-03 16:05
Rane31-Dec-03 16:05 
GeneralRe: A Doubt Pin
Prakash Nadar31-Dec-03 18:35
Prakash Nadar31-Dec-03 18:35 
GeneralRe: A Doubt Pin
Michael Dunn31-Dec-03 19:48
sitebuilderMichael Dunn31-Dec-03 19:48 
Generalproblem with ListCtrl display Pin
Angel Kid31-Dec-03 15:14
Angel Kid31-Dec-03 15:14 
GeneralRe: problem with ListCtrl display Pin
Michael Dunn31-Dec-03 19:50
sitebuilderMichael Dunn31-Dec-03 19:50 
Generalgoing to post antialiasing article Pin
Roman Nurik31-Dec-03 12:56
Roman Nurik31-Dec-03 12:56 
Generalmenu bar Pin
brian scott31-Dec-03 12:21
brian scott31-Dec-03 12:21 
GeneralUsing SetFont() on a button control Pin
shultas31-Dec-03 11:32
shultas31-Dec-03 11:32 
GeneralRe: Using SetFont() on a button control Pin
Roman Nurik31-Dec-03 12:58
Roman Nurik31-Dec-03 12:58 
GeneralRe: Using SetFont() on a button control Pin
Kelly Herald31-Dec-03 17:28
Kelly Herald31-Dec-03 17:28 
GeneralRe: Using SetFont() on a button control Pin
Rajesh match31-Dec-03 19:56
Rajesh match31-Dec-03 19:56 
GeneralRe: Using SetFont() on a button control Pin
shultas1-Jan-04 9:57
shultas1-Jan-04 9:57 
GeneralRe: Using SetFont() on a button control Pin
J.B.1-Jan-04 18:10
J.B.1-Jan-04 18:10 
GeneralIntercepting Mouse Clicks Pin
__Cerb31-Dec-03 10:06
__Cerb31-Dec-03 10:06 
GeneralRe: Intercepting Mouse Clicks Pin
alex.barylski31-Dec-03 10:17
alex.barylski31-Dec-03 10:17 
GeneralRe: Intercepting Mouse Clicks Pin
__Cerb31-Dec-03 10:26
__Cerb31-Dec-03 10:26 
QuestionUsing CList and collections properly? Pin
Cloaca31-Dec-03 9:01
Cloaca31-Dec-03 9:01 
Hello everyone,

I have been working on an MFC SDI program whose Document actually has lists of lists (and possibly a list of a list of a list). I would like to get into a good habit and be consistent with the way I maintain collections (mostly lists, occasionally arrays and maps). Almost all my objects are derived from CObject (for serializing, etc.).

I guess it comes down to picking between CList<type, type>, CList<type, type&>, CList<type*, type*> and whatever other combinations. To keep sane, I think I always want to use CList<type*, type*>. That way, I just use the new operator at the point where an object needs to be instantiated and call delete on it (while traversing the list or sublist) at the 'outer' list's destructor.

I would like comments about this. Is it safe? Is it a decent practice to keep? How can I prevent double deleting the same objects (if that could even happen)? Does this choice affect how I code the required copy constructor and assignment operator (which always seem to involve references)?

Thanks in advance for any advice and comments!
Happy New Year, Smile | :)
Eric
AnswerRe: Using CList and collections properly? Pin
Cloaca5-Jan-04 4:21
Cloaca5-Jan-04 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.