Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Yeah, but even though i removed PreTranslateMessage(MSG* pMsg) function about the second dialog, it still continued showing me that error:

Debug Assertion Failed: wincore.cpp line 875

The code in wincore.cpp says:

void CWnd::OnFinalRelease()
{
if (m_hWnd != NULL)
DestroyWindow(); // will call PostNcDestroy
else
PostNcDestroy();
}
Posted
Updated 26-Feb-10 8:48am
v3

1 solution

I don't see why you are fiddling with PreTranslateMessage() for your second dialog. The escape key should activate the OnCancel() of your second dialog. The one provided in CDialog should close the dialog.

Edit:

Well, one item eliminated though it wasn't the problem. I have several thoughts/suggestions. I don't know if any will be helpful.

1) A dialog box without any controls on it is decidedly odd. I don't know why you want such a thing. I also don't know how microsoft's code will or won't deal with such a thing. Try adding a control that can accept focus ( a push button will do) to your dialog even though you don't have it doing anything. Does it make a difference?

2) Can you use the debugger & check/confirm which window/dialog is triggering the assertion?

3) You are not showing the actual assertion that failed. What is it? It should be on the referenced line in the source code.

4) How are you handling closing your main (first) dialog?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900