Print Page | Close Window

Assert when exiting a MDI app

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7429
Printed Date: 09 May 2024 at 10:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Assert when exiting a MDI app
Posted By: Alex
Subject: Assert when exiting a MDI app
Date Posted: 22 June 2007 at 11:18am
Hello,
 
sometimes, when I close my app, I got an ASSERT :
 
#ifdef _DEBUG
void CHandleMap::RemoveHandle(HANDLE h)
{
 // make sure the handle entry is consistent before deleting
 CObject* pTemp = LookupTemporary(h);
 if (pTemp != NULL)
 {
  // temporary objects must have correct handle values
  HANDLE* ph = (HANDLE*)((BYTE*)pTemp + m_nOffset);  // after CObject
  ASSERT(ph[0] == h || ph[0] == NULL);
  if (m_nHandles == 2)
   ASSERT(ph[1] == h);    <<<<<<
 }
The stack is like :

> mfc80d.dll!CHandleMap::RemoveHandle(void * h=0xb8012aca)  Line 218 + 0x1e bytes C++
  mfc80d.dll!CDC::Detach()  Line 122 C++
  mfc80d.dll!CClientDC::~CClientDC()  Line 1034 + 0x8 bytes C++
  STBSim.exe!CXTPToolBar::CalcDockingLayout(int nLength=1499, unsigned long dwMode=11, int nWidth=0)  Line 746 + 0x2f bytes C++
  STBSim.exe!CXTPDockBar::_AdjustRow(CArray<CXTPToolBar *,CXTPToolBar *> & arrRow={...}, CPoint pt={...}, int nLength=1499, int bHorz=2, AFX_SIZEPARENTPARAMS * lpLayout=0x0012d564, int & nRemove=-1)  Line 180 + 0x2d bytes C++
  STBSim.exe!CXTPDockBar::AdjustRow(CArray<CXTPToolBar *,CXTPToolBar *> & arrRow={...}, CPoint pt={...}, int nLength=1499, int bHorz=2, AFX_SIZEPARENTPARAMS * lpLayout=0x0012d564)  Line 343 + 0x24 bytes C++
  STBSim.exe!CXTPDockBar::CalcDynamicLayout(int nLength=1499, unsigned long nMode=11, AFX_SIZEPARENTPARAMS * lpLayout=0x0012df88)  Line 403 + 0x23 bytes C++
  STBSim.exe!CXTPDockBar::OnSizeParent(unsigned int __formal=0, long lParam=1236872)  Line 460 C++
  mfc80d.dll!CWnd::OnWndMsg(unsigned int message=865, unsigned int wParam=0, long lParam=1236872, long * pResult=0x0012d884)  Line 2004 + 0x11 bytes C++

It's a MDI app with 3 open documents / frame windows. 2 different doc types.
 
Any ideas ?
 
Thx ín advance,
Alex



Replies:
Posted By: Oleg
Date Posted: 22 June 2007 at 1:27pm
Hi,
 
Do you have another thread that can cleanup MFC GDI maps?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Alex
Date Posted: 25 June 2007 at 3:15am
Hello,
 
not really. I have only the main thread which resposible for the GUI.
 
There are other threads, but they are not gui related. BTW, they are not active anymore when the app is about to exit.
 
Do you think a parallel thread is causing the problem ?
 
Alex


Posted By: Oleg
Date Posted: 26 June 2007 at 1:18am

Hi,

Difficult to say without any code :(

 
Send your mainfrm.cpp and full stack  to support@codejock.com.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net