Solved

ASSERTION ERROR

Posted on 2002-04-03
5
500 Views
Last Modified: 2012-06-27
Hi, I have a CDialog from which I open another CDialog. From the second Dialog I open an Open FileDialog I select the file to open.To this point everything works fine. However once the file dialog is closed I get an Assertion Error with respect to the following line in wincore.cpp

Line 628:  ASSERT(pWnd->m_hWnd == NULL);   // only do once

Although this is probably something small I can't see what is causing. Anyone have any Ideas...

Cheers...
Ber...
0
Comment
Question by:Ber
  • 3
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 6916397
One way or another you're trying to access a window that no longer exists.  Stop doing it and the assertion will stop complaining.
0
 
LVL 2

Author Comment

by:Ber
ID: 6916440
If the window didn't exist then there would be no problem
because the assertion would evaluate to true
ie. if there were no window handle then it would be equal to NULL ASSERT(pWnd->m_hWnd == NULL);
So the window still exists...???

Ber...
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 6916576
What is the call stack when this ASSERT occurs? It seems that you are creating a window more than once...
0
 
LVL 2

Author Comment

by:Ber
ID: 6916597
Call Stack :

KERNEL32! bff768a0()
_CrtDbgReport(int 2, const char * 0x5f4cccf0 THIS_FILE, int 628, const char * 0x00000000, const char * 0x00000000) line 353
AfxAssertFailedLine(const char * 0x5f4cccf0 THIS_FILE, int 628) line 39 + 20 bytes
AfxHookWindowCreate(CWnd * 0x00781590 {CEdit hWnd=0x000009f8}) line 628 + 24 bytes
CWnd::CreateEx(unsigned long 0, const char * 0x5f4b095c ??_C@_04IGNI@EDIT?$AA@, const char * 0x00000000, unsigned long 1350631552, int 10, int 10, int 290, int 20, HWND__ * 0x00000340, HMENU__ * 0x00000001, void * 0x00000000) line 694
CWnd::Create(const char * 0x5f4b095c ??_C@_04IGNI@EDIT?$AA@, const char * 0x00000000, unsigned long 1350631552, const tagRECT & {top=10 bottom=30 left=10 right=300}, CWnd * 0x0065f438 {CLoadImage hWnd=???}, unsigned int 1, CCreateContext * 0x00000000) line 743
CEdit::Create(unsigned long 1350631552, const tagRECT & {top=10 bottom=30 left=10 right=300}, CWnd * 0x0065f438 {CLoadImage hWnd=???}, unsigned int 1) line 233
CLoadImage::OnPaint() line 69
CWnd::OnWndMsg(unsigned int 15, unsigned int 0, long 0, long * 0x0065a890) line 1825
CWnd::WindowProc(unsigned int 15, unsigned int 0, long 0) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x0065f438 {CLoadImage hWnd=???}, HWND__ * 0x00000340, unsigned int 15, unsigned int 0, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00000340, unsigned int 15, unsigned int 0, long 0) line 368
AfxWndProcBase(HWND__ * 0x00000340, unsigned int 15, unsigned int 0, long 0) line 220 + 21 bytes
KERNEL32! bff7363b()
KERNEL32! bff94407()

Ber...
0
 
LVL 2

Author Comment

by:Ber
ID: 6916634
jkr got it in one ... I can't believe I didn't spot it

Cheers...
Ber...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now