Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: convert Cpoint to CRect Pin
patelmayur31-May-11 3:09
patelmayur31-May-11 3:09 
QuestionStrings [SOLVED] Pin
goldenrose914-Feb-11 19:24
goldenrose914-Feb-11 19:24 
AnswerRe: Strings Pin
ShilpiP14-Feb-11 19:53
ShilpiP14-Feb-11 19:53 
GeneralRe: Strings Pin
goldenrose914-Feb-11 21:59
goldenrose914-Feb-11 21:59 
GeneralRe: Strings Pin
ShilpiP14-Feb-11 22:15
ShilpiP14-Feb-11 22:15 
GeneralRe: Strings Pin
goldenrose914-Feb-11 23:26
goldenrose914-Feb-11 23:26 
GeneralRe: Strings Pin
ShilpiP14-Feb-11 23:29
ShilpiP14-Feb-11 23:29 
AnswerRe: Strings Pin
CPallini14-Feb-11 21:32
mveCPallini14-Feb-11 21:32 
QuestionCorruption of the Heap Error Pin
Foothill14-Feb-11 10:40
professionalFoothill14-Feb-11 10:40 
AnswerRe: Corruption of the Heap Error Pin
David Crow14-Feb-11 11:55
David Crow14-Feb-11 11:55 
GeneralRe: Corruption of the Heap Error Pin
Foothill14-Feb-11 14:26
professionalFoothill14-Feb-11 14:26 
GeneralRe: Corruption of the Heap Error Pin
David Crow14-Feb-11 17:11
David Crow14-Feb-11 17:11 
GeneralRe: Corruption of the Heap Error Pin
ShilpiP14-Feb-11 19:13
ShilpiP14-Feb-11 19:13 
AnswerRe: Corruption of the Heap Error Pin
ShilpiP14-Feb-11 19:11
ShilpiP14-Feb-11 19:11 
AnswerRe: Corruption of the Heap Error Pin
Niklas L14-Feb-11 21:17
Niklas L14-Feb-11 21:17 
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 

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.