Click here to Skip to main content
15,883,705 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ListView / Win32 Pin
Richard MacCutchan18-Apr-10 4:45
mveRichard MacCutchan18-Apr-10 4:45 
AnswerRe: ListView / Win32 Pin
peterchen12-Apr-10 20:28
peterchen12-Apr-10 20:28 
QuestionComboBox / Win32 Pin
Fareed Rizkalla11-Apr-10 9:42
Fareed Rizkalla11-Apr-10 9:42 
QuestionC++ class pointers Pin
rupeshkp72811-Apr-10 6:52
rupeshkp72811-Apr-10 6:52 
AnswerRe: C++ class pointers Pin
peterchen11-Apr-10 8:25
peterchen11-Apr-10 8:25 
GeneralRe: C++ class pointers [modified] Pin
Joe Woodbury11-Apr-10 13:52
professionalJoe Woodbury11-Apr-10 13:52 
GeneralRe: C++ class pointers Pin
peterchen12-Apr-10 0:04
peterchen12-Apr-10 0:04 
GeneralRe: C++ class pointers Pin
Joe Woodbury12-Apr-10 6:30
professionalJoe Woodbury12-Apr-10 6: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 20:27
peterchen12-Apr-10 20:27 
GeneralRe: C++ class pointers Pin
Tim Craig11-Apr-10 17:32
Tim Craig11-Apr-10 17:32 
GeneralRe: C++ class pointers Pin
rupeshkp72811-Apr-10 19:30
rupeshkp72811-Apr-10 19:30 
GeneralRe: C++ class pointers Pin
peterchen12-Apr-10 20:33
peterchen12-Apr-10 20:33 
GeneralRe: C++ class pointers Pin
Tim Craig12-Apr-10 21:00
Tim Craig12-Apr-10 21:00 
AnswerRe: C++ class pointers Pin
Emilio Garavaglia11-Apr-10 20:58
Emilio Garavaglia11-Apr-10 20:58 
QuestionC++Linking Classes/.cpp files to run one after other? Pin
FinalDecap11-Apr-10 5:59
FinalDecap11-Apr-10 5:59 
AnswerRe: C++Linking Classes/.cpp files to run one after other? Pin
Cedric Moonen11-Apr-10 20:57
Cedric Moonen11-Apr-10 20:57 
QuestionArray indexes Pin
Farraj10-Apr-10 23:46
Farraj10-Apr-10 23:46 
AnswerRe: Array indexes Pin
Nelek11-Apr-10 0:26
protectorNelek11-Apr-10 0:26 
AnswerRe: Array indexes Pin
Saurabh.Garg11-Apr-10 2:01
Saurabh.Garg11-Apr-10 2:01 
AnswerRe: Array indexes Pin
Luc Pattyn11-Apr-10 2:15
sitebuilderLuc Pattyn11-Apr-10 2:15 
AnswerRe: Array indexes Pin
Farraj11-Apr-10 3:04
Farraj11-Apr-10 3:04 
GeneralRe: Array indexes Pin
Luc Pattyn11-Apr-10 3:30
sitebuilderLuc Pattyn11-Apr-10 3:30 
GeneralRe: Array indexes Pin
Farraj11-Apr-10 11:27
Farraj11-Apr-10 11:27 
GeneralRe: Array indexes Pin
Luc Pattyn11-Apr-10 11:47
sitebuilderLuc Pattyn11-Apr-10 11:47 
GeneralRe: Array indexes Pin
Farraj14-Apr-10 8:30
Farraj14-Apr-10 8: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.