Solved

ASSERTION ERROR

Posted on 2002-04-03
5
503 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

821 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