Solved

ASSERTION ERROR

Posted on 2002-04-03
5
511 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 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…

691 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