Re: DAMAGE after client block
- From: "cbdeja@xxxxxxxxxxx" <cbdeja@xxxxxxxxxxx>
- Date: Sun, 11 Nov 2007 11:01:04 -0800
Thanks for the comments everyone.
You are probably passing it to a BOOL* somewhere, or someone is expected something
sizeof(BOOL). Since sizeof(bool) != sizeof(BOOL), you are causing memory damage.
That would certainly make sense. However, just the presence of the
bool member variable is enough to cause the DAMAGE error message -
i.e. the bool variable is not used at all anywhere in the class.
I slimmed the whole thing down to the two statements "new" and
"delete" which I posted in my original message.
The constructors and the destructor have "return" as their first
statement, and I do not call any methods of the class.
So NO code is running in the class at all - I'm just creeting and
deleting the class, with constructor/destructors which do nothing. But
still the problem occurs.
The solution is simple: don't use bool if someone is expecting BOOL.
No one is using the variable at all.
Since you did not say anything about how it is used, you have not
supplied anything useful in this message to
help us diagnose the problem, but it is certainly related to that.
I could post the whole contents of the CProgressWnd class, but as I've
said I've slimmed it down to the point that none of the code executes.
The example you gave is insufficient to diagnose the problem, since
it could involve the constructor of the class or other effects.
The constructor is effectively "empty" because its first statement is
"return", and the rest of the class's code does not execute.
Also, in cases like this, make sure you do a 'Rebuild Solution'
before worrying about anything else.
Yes, that was the first thing I tried.
It really is very strange. I can't see how just allocating space for
the CProgressWnd object, executing a couple of return statements and
deleting it can cause this. I'm beginning to wonder if this is a bug
in the debugger.
.
- Follow-Ups:
- Re: DAMAGE after client block
- From: Joseph M . Newcomer
- Re: DAMAGE after client block
- From: Giovanni Dicanio
- Re: DAMAGE after client block
- References:
- DAMAGE after client block
- From: cbdeja@xxxxxxxxxxx
- Re: DAMAGE after client block
- From: Joseph M . Newcomer
- DAMAGE after client block
- Prev by Date: Re: MFC updates and enhancements
- Next by Date: Re: problem with flickering in dialog
- Previous by thread: Re: DAMAGE after client block
- Next by thread: Re: DAMAGE after client block
- Index(es):
Relevant Pages
|