Post by Paul Lennon Post by Nathan Mates
I've seen similar things before, where items launched by the
debugger (F5 key to run, with the VC++ keyboard shortcuts) works, and
items launched with Ctrl-F5 (run, not under debugger) failed. Pretty
much all of those turned out to be misuse of uninitialized memory.
Try ensuring that your class/struct constructors reset all member
variables, and that you deal with allocated memory correctly as well.
Thank you for the suggestion. I found the problem and it was me! I
revisited my RichEdit construction, removed some unnecessary variables
and found some key ones that were not set correctly.
That's what I thought. I wish that running under the debugger was
slightly more reliable in terms of misbehaving the same way as not
under the debugger. I've also been wanting an (optional, of course)
warning when all members of a class/struct aren't initialized by the
constructors. I've seen projects I'm on get bitten so many times when
a class has 15-odd member variables, and 4 constructors. Then, someone
adds member variable #16, and updates 1-3 of the constructors. Boom.
Occasionally. I want that to be a warning, and I'd upgrade that to an
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein