first of all Thanku Mr.Doug Forster for ur response.
My scenario is:
In CMainframe class , I add my own class called CChildWindow
which is derived from CScrollview. In CChildWindow I added my own class
called CPagewindow which is been derived from CFrameWnd.The place where
I get error is , While I am trying to close my main application,
CMainframe's OnClose() is called which in turn calls CChildWindow's
OnClose() where the Pagewindow->DestroyWindow() is called. Here only
the assertion occurs.
CMainframe -CChildWindow -CPageWindow -DestroyWindow()
The Code follows as:
void CMainFrame::OnClose()
{
GlobalMembers::m_PageWindowHandle=m_ChildWnd->m_structPgDetails[i].PageHandle;
m_ChildWnd->OnClose();
CFrameWnd::OnClose();
}
void CChildWindow::OnClose()
{
pagewindow->DestroyWindow();
}
///// Asserts here in destroy window
Debug Assertion Failed!
program:................
File: wincore.cpp
Line: 958
/////
Doug Forster wrote:
Hi,
You wouldn't normally call DestroyWindow for a CFrameWnd. Could you explain
why you are trying to do this and show us some of your code.
Cheers
Doug Forster
"Mullai" <mu*******@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi ,
My program gives an error message like this
Debug Assertion Failed!
program:................
File: wincore.cpp
Line: 958
Please can anyone help me out in this issue. I have to solve this bug
immediately in my project.
The line 958 is as follows in wincore.cpp
When I am trying to close my window created CFrameWnd class by calling
DestroyWindow() this assertion has been asserted.
BOOL CWnd::DestroyWindow()
{
if (m_hWnd == NULL)
return FALSE;
CHandleMap* pMap = afxMapHWND(); ///// line 958/////
ASSERT(pMap != NULL);
CWnd* pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);
Thanks
Mullai