[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASSERTION ERROR

Posted on 2002-04-03
5
Medium Priority
?
670 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 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

864 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