Print Page | Close Window

OnOpenDocument() returns false -> assert failed.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7371
Printed Date: 13 November 2025 at 2:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: OnOpenDocument() returns false -> assert failed.
Posted By: CoeneW
Subject: OnOpenDocument() returns false -> assert failed.
Date Posted: 13 June 2007 at 8:21am
Hi,

I've reached a bit of a dead end, and am hoping someone where can maybe shine some light on what I'm doing wrong. This concerns an MDI application written in C++ using Visual Studio 2003, MFC and Xtreme Toolkit Pro (version 4.2).

Whenever OnOpenDocument() on my CDocument-deriviative returns FALSE, an assertion failure is triggered in CXTPMenuBar::GetActiveMdiChildWnd(): "hWnd == NULL || ::IsWindow(hWnd)". The relevant bit of the call stack is as follows:

  • mfc71ud.dll!AfxAssertFailedLine(const char * lpszFileName=0x00ce4fb0, int nLine=385)  Line 27
  • X.exe!CXTPMenuBar::GetActiveMdiChildWnd(int * bMaximized=0x00000000)  Line 385 + 0x31
  • X.exe!CXTPMenuBar::SyncActiveMdiChild()  Line 393 + 0xa
  • X.exe!CXTPMenuBar::RefreshMenu()  Line 408
  • X.exe!CXTPMenuBar::OnTimer(unsigned int nIDEvent=12223)  Line 735
  • mfc71ud.dll!CWnd::OnWndMsg(unsigned int message=275, unsigned int wParam=12223, long lParam=0, long * pResult=0x0012fca0)  Line 2027

It appears to be somewhat timing-related, because the bug is somehow not triggered when I set a breakpoint in CXTPMenuBar::OnHookMessage() on line 678 (where the WM_TIMER message triggering this apparently originates).

What looks really strange to me is the fact that the hWnd that is tested for being a proper window in CXTPMenuBar::GetActiveMdiChildWnd() is the result of a WM_MDIGETACTIVE message to the MDI area, so it's as if Windows itself is returning a window handle that isn't even a proper window!

Anybody here have any ideas?

Thanks,
Wouter



Replies:
Posted By: CoeneW
Date Posted: 13 June 2007 at 9:18am
Never mind, I've solved the issue. This is caused by my own view's OnCreate() doing a SetActiveView() on its parent frame (who would've thought).



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