Discussion:
Debug assertion failed but not failed in release version
(too old to reply)
p2
2007-02-28 05:19:44 UTC
Permalink
Hi

i got "debug assertion failed" in debug version while not get in
release version .

i created dialog box in thread in thread in that i pass parent HWND

when i call "DoModal()" it failed

it failed in WINCORE.CPP at
ASSERT((CWnd*)p == this); // must be us
line,

as i know ,in release version all ASSERT statement are not considered
(compiled) so i am not got in release.

Is there any solution for dubug version ???

thanks in advance

will it create any problem in release version ???

p2
Scott McPhillips [MVP]
2007-02-28 06:25:03 UTC
Permalink
Post by p2
Hi
i got "debug assertion failed" in debug version while not get in
release version .
i created dialog box in thread in thread in that i pass parent HWND
when i call "DoModal()" it failed
it failed in WINCORE.CPP at
ASSERT((CWnd*)p == this); // must be us
line,
as i know ,in release version all ASSERT statement are not considered
(compiled) so i am not got in release.
Is there any solution for dubug version ???
thanks in advance
will it create any problem in release version ???
Yes, it could cause problems in the release version. The pointer p will
still be wrong in the release version, so anything that uses p could
cause problems.

The problem could be related to MFC limitations. An MFC window that was
created in one thread cannot be used in another thread, and there are
many ASSERTs in MFC to check for this.

The solution is to put all your GUI in the main thread.
--
Scott McPhillips [VC++ MVP]
Loading...