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

C / C++ / MFC

 
AnswerRe: Corruption of the Heap Error Pin
Stefan_Lang15-Feb-11 6:52
Stefan_Lang15-Feb-11 6:52 
GeneralRe: Corruption of the Heap Error Pin
Niklas L15-Feb-11 10:54
Niklas L15-Feb-11 10:54 
GeneralRe: Corruption of the Heap Error Pin
Stefan_Lang15-Feb-11 22:10
Stefan_Lang15-Feb-11 22:10 
GeneralRe: Corruption of the Heap Error [modified] Pin
Niklas L15-Feb-11 22:37
Niklas L15-Feb-11 22:37 
GeneralRe: Corruption of the Heap Error Pin
Stefan_Lang15-Feb-11 22:51
Stefan_Lang15-Feb-11 22:51 
GeneralRe: Corruption of the Heap Error [modified] Pin
Niklas L15-Feb-11 23:13
Niklas L15-Feb-11 23:13 
GeneralRe: Corruption of the Heap Error Pin
Niklas L16-Feb-11 6:57
Niklas L16-Feb-11 6:57 
GeneralRe: Corruption of the Heap Error Pin
Stefan_Lang16-Feb-11 22:22
Stefan_Lang16-Feb-11 22:22 
Thanks for your effort but I'm afraid it goes wasted. I totally understood what this is about, As I pointed out before, it's like what new and delete do, only that they're not bothering to define a struct. And, btw., CDLGTEMPLATEEX is probably worse than that, as not only is there no actual definition of that 'struct', some of it's members may be missing entirely! That's what confused me.

I still fail to see why it's better to hack a struct than just use pointers for the dynamic parts. That kind of coding was bad style in times before C++, and it's even worse nowadays. I'd put it on par with using goto, but that might do goto injustice. What we're talking about here is self-modifying data, and I don't see how that is any better than self-modifying code.

The only justification I can think of is some low level code that is really, and I mean REALLY keen to save the extra memory required for the pointer(s). For coding it makes no difference at all. For memory usage, you just need one additional pointer for the dynamically sized part. For efficiency, you only add one level of indirection for resolving access to elements of the dynamic part. In return you get clear data structures that describe what is actually there, remove the need to unsafe type-casting, and get code that is much more readable and maintainable.

IMHO, that MS is still using such techniques is an abomination. And it is no reason to use such techniques yourself.
GeneralRe: Corruption of the Heap Error Pin
Niklas L16-Feb-11 23:12
Niklas L16-Feb-11 23:12 
GeneralRe: Corruption of the Heap Error Pin
Stefan_Lang17-Feb-11 1:10
Stefan_Lang17-Feb-11 1:10 
GeneralRe: Corruption of the Heap Error Pin
Niklas L17-Feb-11 1:34
Niklas L17-Feb-11 1:34 
GeneralRe: Corruption of the Heap Error Pin
Stefan_Lang17-Feb-11 1:42
Stefan_Lang17-Feb-11 1:42 
GeneralRe: Corruption of the Heap Error Pin
Foothill15-Feb-11 11:16
professionalFoothill15-Feb-11 11:16 
QuestionHow to use CMFCVisualManagerOffice2007 in dialog App? Pin
stephen_young14-Feb-11 3:24
stephen_young14-Feb-11 3:24 
AnswerRe: How to use CMFCVisualManagerOffice2007 in dialog App? Pin
David Crow14-Feb-11 3:43
David Crow14-Feb-11 3:43 
GeneralRe: How to use CMFCVisualManagerOffice2007 in dialog App? Pin
stephen_young14-Feb-11 6:14
stephen_young14-Feb-11 6:14 
QuestionMulti Language Support Pin
T.RATHA KRISHNAN14-Feb-11 2:44
T.RATHA KRISHNAN14-Feb-11 2:44 
AnswerRe: Multi Language Support Pin
loyal ginger14-Feb-11 10:16
loyal ginger14-Feb-11 10:16 
AnswerRe: Multi Language Support Pin
yu-jian14-Feb-11 16:29
yu-jian14-Feb-11 16:29 
AnswerRe: Multi Language Support Pin
ShilpiP14-Feb-11 18:17
ShilpiP14-Feb-11 18:17 
AnswerRe: Multi Language Support Pin
RaviRanjanKr16-Feb-11 3:02
professionalRaviRanjanKr16-Feb-11 3:02 
QuestionImplementing Remeber me Facility Pin
pix_programmer14-Feb-11 2:12
pix_programmer14-Feb-11 2:12 
AnswerRe: Implementing Remeber me Facility Pin
CPallini14-Feb-11 2:33
mveCPallini14-Feb-11 2:33 
GeneralRe: Implementing Remeber me Facility Pin
pix_programmer14-Feb-11 2:41
pix_programmer14-Feb-11 2:41 
GeneralRe: Implementing Remeber me Facility Pin
CPallini14-Feb-11 2:56
mveCPallini14-Feb-11 2:56 

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.