Click here to Skip to main content
15,903,385 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Resolving mail server name Pin
valikac7-Jan-04 7:26
valikac7-Jan-04 7:26 
QuestionHow do i disable a popup menu item in runtime? Pin
oren frenkel7-Jan-04 5:33
oren frenkel7-Jan-04 5:33 
AnswerRe: How do i disable a popup menu item in runtime? Pin
Iain Clarke, Warrior Programmer7-Jan-04 6:05
Iain Clarke, Warrior Programmer7-Jan-04 6:05 
GeneralCalculate the Array search time in millisecondes Pin
naif6207-Jan-04 5:04
naif6207-Jan-04 5:04 
GeneralRe: Calculate the Array search time in millisecondes Pin
David Crow7-Jan-04 8:49
David Crow7-Jan-04 8:49 
GeneralRe: Calculate the Array search time in millisecondes Pin
naif6208-Jan-04 4:50
naif6208-Jan-04 4:50 
GeneralRe: Calculate the Array search time in millisecondes Pin
David Crow8-Jan-04 6:04
David Crow8-Jan-04 6:04 
QuestionIs this good form? Pin
Cloaca7-Jan-04 4:49
Cloaca7-Jan-04 4:49 
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!
Eric
AnswerRe: Is this good form? Pin
Christian Graus7-Jan-04 10:05
protectorChristian Graus7-Jan-04 10:05 
GeneralRe: Is this good form? Pin
Cloaca7-Jan-04 11:53
Cloaca7-Jan-04 11:53 
AnswerRe: Is this good form? Pin
Mike Dimmick8-Jan-04 2:27
Mike Dimmick8-Jan-04 2:27 
GeneralRe: Is this good form? Pin
Cloaca8-Jan-04 5:02
Cloaca8-Jan-04 5:02 
GeneralRe: Is this good form? Pin
Mike Dimmick8-Jan-04 5:23
Mike Dimmick8-Jan-04 5:23 
GeneralRe: Is this good form? Pin
Cloaca8-Jan-04 11:33
Cloaca8-Jan-04 11:33 
GeneralAdding text display to dialog box Pin
Anonymous7-Jan-04 4:36
Anonymous7-Jan-04 4:36 
GeneralRe: Adding text display to dialog box Pin
valikac7-Jan-04 7:28
valikac7-Jan-04 7:28 
GeneralHelp with HANDLEs Pin
Mortis7-Jan-04 4:14
Mortis7-Jan-04 4:14 
GeneralRe: Help with HANDLEs Pin
Dominik Reichl7-Jan-04 4:33
Dominik Reichl7-Jan-04 4:33 
GeneralRe: Help with HANDLEs Pin
valikac7-Jan-04 7:29
valikac7-Jan-04 7:29 
GeneralFucntion execution time Pin
islheg7-Jan-04 3:49
islheg7-Jan-04 3:49 
GeneralRe: Fucntion execution time Pin
фил7-Jan-04 4:30
фил7-Jan-04 4:30 
GeneralRe: Fucntion execution time Pin
oren frenkel7-Jan-04 6:27
oren frenkel7-Jan-04 6:27 
GeneralRe: Fucntion execution time Pin
Alexander M.,7-Jan-04 10:55
Alexander M.,7-Jan-04 10:55 
GeneralRe: Fucntion execution time Pin
pankajdaga8-Jan-04 3:57
pankajdaga8-Jan-04 3:57 
GeneralRe: Fucntion execution time Pin
islheg10-Jan-04 12:10
islheg10-Jan-04 12:10 

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.