Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - OnOpenDocument() returns false -> assert failed.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

OnOpenDocument() returns false -> assert failed.

 Post Reply Post Reply
Author
Message
CoeneW View Drop Down
Newbie
Newbie


Joined: 13 June 2007
Location: Netherlands
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CoeneW Quote  Post ReplyReply Direct Link To This Post Topic: OnOpenDocument() returns false -> assert failed.
    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
Back to Top
CoeneW View Drop Down
Newbie
Newbie


Joined: 13 June 2007
Location: Netherlands
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CoeneW Quote  Post ReplyReply Direct Link To This Post 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).
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.046 seconds.