Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Assert when exiting a MDI app
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Assert when exiting a MDI app

 Post Reply Post Reply
Author
Message
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post Topic: Assert when exiting a MDI app
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.