Click here to Skip to main content
15,792,451 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ListView / Win32 Pin
Richard MacCutchan18-Apr-10 5:45
mveRichard MacCutchan18-Apr-10 5:45 
AnswerRe: ListView / Win32 Pin
peterchen12-Apr-10 21:28
peterchen12-Apr-10 21:28 
QuestionComboBox / Win32 Pin
Fareed Rizkalla11-Apr-10 10:42
Fareed Rizkalla11-Apr-10 10:42 
QuestionC++ class pointers Pin
rupeshkp72811-Apr-10 7:52
rupeshkp72811-Apr-10 7:52 
AnswerRe: C++ class pointers Pin
peterchen11-Apr-10 9:25
peterchen11-Apr-10 9:25 
GeneralRe: C++ class pointers [modified] Pin
Joe Woodbury11-Apr-10 14:52
professionalJoe Woodbury11-Apr-10 14:52 
GeneralRe: C++ class pointers Pin
peterchen12-Apr-10 1:04
peterchen12-Apr-10 1:04 
GeneralRe: C++ class pointers Pin
Joe Woodbury12-Apr-10 7:30
professionalJoe Woodbury12-Apr-10 7:30 
peterchen wrote:
The bnext time you write a class holding a file handle, you will again have to implement/block the Default + Copy CTor, DTor and Assignment Operator for a properly behaving class.


If you choose to have copy constructors and assignment operators, you still have to write them with a class full of encapsulated objects.
The alternative is to block copy constructors and assignment operators, which is quite easy. I have quite a few classes where I do that.

(For the record, I've encapsulated a file handle and synchronization objects, though I don't always use them for various reasons; I make a decision on a case-by-case basis, based on what is best for that class, not on any rules.)

peterchen wrote:
you have to deal with cleanup of a partially constructed class.


I can't remember the last time I even worried about that; I just write my code such that it's irrelevant AND so that a class always constructs. (I don't do this in C#, but I accept slow and bloated in C#, but not in C++.)
GeneralRe: C++ class pointers Pin
peterchen12-Apr-10 21:27
peterchen12-Apr-10 21:27 
GeneralRe: C++ class pointers Pin
Tim Craig11-Apr-10 18:32
Tim Craig11-Apr-10 18:32 
GeneralRe: C++ class pointers Pin
rupeshkp72811-Apr-10 20:30
rupeshkp72811-Apr-10 20:30 
GeneralRe: C++ class pointers Pin
peterchen12-Apr-10 21:33
peterchen12-Apr-10 21:33 
GeneralRe: C++ class pointers Pin
Tim Craig12-Apr-10 22:00
Tim Craig12-Apr-10 22:00 
AnswerRe: C++ class pointers Pin
Emilio Garavaglia11-Apr-10 21:58
Emilio Garavaglia11-Apr-10 21:58 
QuestionC++Linking Classes/.cpp files to run one after other? Pin
FinalDecap11-Apr-10 6:59
FinalDecap11-Apr-10 6:59 
AnswerRe: C++Linking Classes/.cpp files to run one after other? Pin
Cedric Moonen11-Apr-10 21:57
Cedric Moonen11-Apr-10 21:57 
QuestionArray indexes Pin
Farraj11-Apr-10 0:46
Farraj11-Apr-10 0:46 
AnswerRe: Array indexes Pin
Nelek11-Apr-10 1:26
protectorNelek11-Apr-10 1:26 
AnswerRe: Array indexes Pin
Saurabh.Garg11-Apr-10 3:01
Saurabh.Garg11-Apr-10 3:01 
AnswerRe: Array indexes Pin
Luc Pattyn11-Apr-10 3:15
sitebuilderLuc Pattyn11-Apr-10 3:15 
AnswerRe: Array indexes Pin
Farraj11-Apr-10 4:04
Farraj11-Apr-10 4:04 
GeneralRe: Array indexes Pin
Luc Pattyn11-Apr-10 4:30
sitebuilderLuc Pattyn11-Apr-10 4:30 
GeneralRe: Array indexes Pin
Farraj11-Apr-10 12:27
Farraj11-Apr-10 12:27 
GeneralRe: Array indexes Pin
Luc Pattyn11-Apr-10 12:47
sitebuilderLuc Pattyn11-Apr-10 12:47 
GeneralRe: Array indexes Pin
Farraj14-Apr-10 9:30
Farraj14-Apr-10 9:30 

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.