Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralNMAKE, Implicit Rules and unknown file types Pin
Bryan Anslow31-Dec-03 8:06
Bryan Anslow31-Dec-03 8:06 
GeneralDAO in SDK app (supports MFC) Pin
Jay231-Dec-03 6:19
Jay231-Dec-03 6:19 
GeneralRe: DAO in SDK app (supports MFC) Pin
Selvam R1-Jan-04 19:21
professionalSelvam R1-Jan-04 19:21 
GeneralCompare sign of numbers in C++ Pin
Gagnon Claude31-Dec-03 6:19
Gagnon Claude31-Dec-03 6:19 
GeneralRe: Compare sign of numbers in C++ Pin
Dominik Reichl31-Dec-03 6:59
Dominik Reichl31-Dec-03 6:59 
GeneralRe: Compare sign of numbers in C++ Pin
Stefan Pedersen1-Jan-04 7:00
Stefan Pedersen1-Jan-04 7:00 
GeneralRe: Compare sign of numbers in C++ Pin
Tim Smith31-Dec-03 10:41
Tim Smith31-Dec-03 10:41 
GeneralResizing controls in MFC Pin
Rafael Fernández López31-Dec-03 5:43
Rafael Fernández López31-Dec-03 5:43 
GeneralRe: Resizing controls in MFC Pin
Michael Dunn31-Dec-03 7:30
sitebuilderMichael Dunn31-Dec-03 7:30 
GeneralChange the selection style of a listbox on the fly Pin
shultas31-Dec-03 4:44
shultas31-Dec-03 4:44 
GeneralRe: Change the selection style of a listbox on the fly Pin
valikac31-Dec-03 5:31
valikac31-Dec-03 5:31 
GeneralRe: Change the selection style of a listbox on the fly Pin
Michael Dunn31-Dec-03 7:34
sitebuilderMichael Dunn31-Dec-03 7:34 
GeneralRe: Change the selection style of a listbox on the fly Pin
shultas31-Dec-03 11:11
shultas31-Dec-03 11:11 
GeneralRe: Change the selection style of a listbox on the fly Pin
Ravi Bhavnani31-Dec-03 19:40
professionalRavi Bhavnani31-Dec-03 19:40 
GeneralRe: Change the selection style of a listbox on the fly Pin
Michael Dunn31-Dec-03 20:16
sitebuilderMichael Dunn31-Dec-03 20:16 
GeneralChange Background color of a word in CRichEditCtrl control Pin
BazM31-Dec-03 3:08
BazM31-Dec-03 3:08 

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.