Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Strange bugs in CXTPDockingPaneAutoHideWnd
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Strange bugs in CXTPDockingPaneAutoHideWnd

 Post Reply Post Reply
Author
Message
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Topic: Strange bugs in CXTPDockingPaneAutoHideWnd
    Posted: 10 August 2007 at 7:52am
Hi Oleg,
 
Two strange behaviors in CXTPDockingPaneAutoHideWnd:
 
 
1) If drag and dropping something from a AutoHide docked pane in the main view, then the implementation of CXTPDockingPaneAutoHideWnd::OnClose() calls the standard MFC CFrameWnd::OnClose() which calls CanCloseFrame() then SaveModified() which popups a MessageBox asking to Save the document...
 
Definitely a bug... I think

CXTPDockingPaneAutoHideWnd::OnClose() shouldn't call CFrameWnd::OnClose() or implement its own way od closing the window.

 
2) When opening an AutoHide pane or passing from an AutoHide to another, most of the time the main view is drawn on top of the AutoHide panes, or part of it. It gets better when disabling the autohide animation, but still there. Reproducable all the time. Very annoying.
 
 
Sorry to be a boring Newbie ;-)
 
Thanks for our quick support as ever.
 
Dominique

 

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: 10 August 2007 at 9:01am
Hello,
 
1. I can't reproduce it with our GUI_VisualStudio sample. I drop from Help pane to main view.
Think you attaching some CView to pane directly without parent CFrameWnd.
Please show full stack.
 
2. Set clip styles for View and Frame:
 
 
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
 // TODO: Modify the Window class or styles here by modifying
 //  the CREATESTRUCT cs
 if( !CFrameWnd::PreCreateWindow(cs) )
  return FALSE;
 cs.style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
 return TRUE;
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2007 at 9:43am

Hi Oleg,

Issue 2 seems OK now. Thanks for the fix.

Issue 1: I create all views that way :
 
CWnd *pWnd = (CWnd *)pClass->CreateObject();

pWnd->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW & ~WS_BORDER, CRect(0,0,0,0), this, nID, &context);

pWnd->SetOwner(this);

("this" is the CMDIChildWnd implementing the DockingPaneManager) 
 
Maybe SetOwner() is not enough ?
 
Please find full call stack below. CFrameWnd::OnClose() learly get the active document and calls CanCloseFrame()... not really logical for the AutoHide frame.
 
Thanks a lot again
 
Dominique
 
 
  ntdll.dll!7c90eb94()  
  user32.dll!77d491be()  
  user32.dll!77d491f1()  
  mfc71ud.dll!AfxInternalPumpMessage()  Line 158 + 0x13 C++
  mfc71ud.dll!CWinThread::PumpMessage()  Line 916 C++
  mfc71ud.dll!AfxPumpMessage()  Line 195 + 0xb C++
  mfc71ud.dll!CWnd::RunModalLoop(unsigned long dwFlags=4)  Line 4566 + 0x5 C++
  mfc71ud.dll!CDialog::DoModal()  Line 527 + 0xc C++
  MTCommonUIud.dll!MTCommonUIMessageBox(CWnd * pParentWnd=0x00000000, const wchar_t * pszText=0x0a371560, const wchar_t * pszCaption=0x014a2270, unsigned int uType=3, const _GUID & guidMessageID={...})  Line 3215 + 0xb C++
  MTCommonUIud.dll!MTCommonUIMessageBox(const wchar_t * pszText=0x0a371560, const wchar_t * pszCaption=0x014a2270, unsigned int uType=3, const _GUID & guidMessageID={...})  Line 3162 + 0x17 C++
  Pyramix.exe!CEDLDoc::SaveModified()  Line 12415 + 0x1c C++
  mfc71ud.dll!CDocument::CanCloseFrame(CFrameWnd * pFrameArg=0x0a36a908)  Line 195 C++
  mfc71ud.dll!CFrameWnd::OnClose()  Line 785 + 0x18 C++
> ToolkitPro1113vc71UD.dll!CXTPDockingPaneAutoHideWnd::OnClose()  Line 403 C++
  mfc71ud.dll!CWnd::OnWndMsg(unsigned int message=16, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f898)  Line 2023 C++
  mfc71ud.dll!CWnd::WindowProc(unsigned int message=16, unsigned int wParam=0, long lParam=0)  Line 1745 + 0x1e C++
  mfc71ud.dll!AfxCallWndProc(CWnd * pWnd=0x0a36a908, HWND__ * hWnd=0x001b0e88, unsigned int nMsg=16, unsigned int wParam=0, long lParam=0)  Line 241 + 0x1a C++
  mfc71ud.dll!AfxWndProc(HWND__ * hWnd=0x001b0e88, unsigned int nMsg=16, unsigned int wParam=0, long lParam=0)  Line 389 C++
  mfc71ud.dll!AfxWndProcBase(HWND__ * hWnd=0x001b0e88, unsigned int nMsg=16, unsigned int wParam=0, long lParam=0)  Line 209 + 0x15 C++
  user32.dll!77d48734()  
  user32.dll!77d48816()  
  user32.dll!77d4c63f()  
  user32.dll!77d4c665()  
  ToolkitPro1113vc71UD.dll!CXTPSkinManagerApiHook::CallWindowProcOrig(long (HWND__ *, unsigned int, unsigned int, long)* lpPrevWndFunc=0x7c3b06a0, HWND__ * hWnd=0x001b0e88, unsigned int Msg=16, unsigned int wParam=0, long lParam=0)  Line 213 + 0x19 C++
  ToolkitPro1113vc71UD.dll!CXTPSkinManager::DoCallWindowProc(long (HWND__ *, unsigned int, unsigned int, long)* lpPrevWndFunc=0x7c3b06a0, HWND__ * hWnd=0x001b0e88, unsigned int Msg=16, unsigned int wParam=0, long lParam=0)  Line 641 C++
  ToolkitPro1113vc71UD.dll!CXTPSkinManager::HookWndProc(HWND__ * hWnd=0x001b0e88, unsigned int message=16, unsigned int wParam=0, long lParam=0)  Line 696 + 0x19 C++
  user32.dll!77d48734()  
  user32.dll!77d48816()  
  user32.dll!77d489cd()  
  ntdll.dll!7c915b4f()  
  mfc71ud.dll!CThreadLocal<AFX_MODULE_THREAD_STATE>::GetData()  Line 177 + 0xd C++
  user32.dll!77d48a10()  
  mfc71ud.dll!AfxInternalPumpMessage()  Line 188 C++
  mfc71ud.dll!CWinThread::PumpMessage()  Line 916 C++
  mfc71ud.dll!CWinThread::Run()  Line 637 + 0xb C++
  mfc71ud.dll!CWinApp::Run()  Line 701 C++
  mfc71ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x0002085a, int nCmdShow=1)  Line 49 + 0xb C++
  Pyramix.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x0002085a, int nCmdShow=1)  Line 25 C++
  Pyramix.exe!wWinMainCRTStartup()  Line 390 + 0x39 C
  kernel32.dll!7c816fd7()  
  ntdll.dll!7c915b4f()  
 
 
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: 13 August 2007 at 1:25am
Hello,
 
As I wrote you create view without parent CFrameWnd. Instead Attach method you can use AttachView - it will create View, its parent frame and attach it to pane. See sources of CXTPDockingPane::AttachView
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2007 at 5:41am
Hi Oleg,
 
Just tried with AttachView... exact same behavior.
 
CXTPDockingPaneAutoHideWnd::OnClose() calls CFrameWnd::OnClose() and then CDocument* pDocument = GetActiveDocument() returns the main document which is modified...
 
I can override CXTPDockingPaneAutoHideWnd::OnClose() to avoid this, but I think this should be done in the toolkit itself...
 
Thanks again for your quick support
 
Dominique
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2007 at 1:44am
Hi Oleg,
 
I tried overiding CXTPDockingPaneManager to be able to generate my own CXTPDockingPaneAutoHidePanel that implements its own CXTPDockingPaneAutoHideWnd... but CXTPDockingPaneAutoHidePanel::ShowPane() is not virtual... so I have to overide all methods calling it as well... not the solution...
 
Is there any hook anywhere that I could use to bypass CXTPDockingPaneAutoHideWnd::OnClose or better CFrameWnd::OnClose() ?

I really have to find a way as we're releasing an important release very soon and this is still an open issue.

Thanks a lot again
 
Dominique
 
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2007 at 8:25am
Hi Oleg,
 
After more investigation and looking at your samples, I guess I no understand why it works in your samples. It's just because you always give a NULL docment to the AttachView() function.
 
The problem in our app is that we have 8 different views that are on docking panes and they all have to have their Document properly set. It CANNOT be NULL... these Views interact together with and through the Document.
 
Any ideas how we could solve this ?
 
In fact we should just find a way to set the CXTPDockingPaneAutoHideWnd document to NULL, or overide its virtual GetActiveDocument() to return NULL.
 
Any easy way of doing so ?
 
Thanks again for your help
 
Dominique
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: 17 August 2007 at 9:06am

Hello,

I tried to add Document but still can't reproduce. May be you manually close/destroy pane after drag and drop ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2007 at 9:35am
Hi Oleg,
 
No, I don't close the the pane manually, I just let things happen.
 
It also happens without drag & drop. If the view inside the pane has the focus then when clicking in the main view, the focus goes to the main, the pane closes automatically and he message appears.
 
If just passing the mouse over the pane button, the pane opens and then moving out of the pane, then it closes without message.
 
The message appears only if the view in the pane got the focus then looses it.
 
I hope it helps
 
Thanks again
 
Dominique
 
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 23 August 2007 at 11:11am
Hi Oleg,
 
Somebody from our team found a solution for this problem.
 
Just have to call CDocument::UpdateFrameCounts() after the views and frames are created so CDocument::CanCloseFrame() properly does its job when closing CXTPDockingPaneAutoHideWnds.
 
Thanks again for your time on this one
 
Cheers,
 
Dominique
Back to Top
dbrulhart View Drop Down
Groupie
Groupie


Joined: 19 October 2006
Location: Switzerland
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote dbrulhart Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2007 at 10:51am
Hi Oleg,
 
Previous solution with UpdateFramesCount() doesn't work either.
 
We found another solution: overidding CDocument::CanCloseFrame() and allow closing frames here if the given frame is not the main CMDIChildWnd().
 
For all those interested, this is our current status.
 
Thanks to all
 
Dominique
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.172 seconds.