|  | 
| CXTPTabClientWnd - EnableTearOff issues | 
| Post Reply   | 
| Author | |
| jw_statica   Groupie   Joined: 23 May 2018 Status: Offline Points: 36 |  Post Options  Thanks(0)  Quote  Reply  Topic: CXTPTabClientWnd - EnableTearOff issues Posted: 10 February 2025 at 5:24am | 
| 
   If you enable tear off in CXTPTabClientWnd object, you can take off tabs from the window and it works, it will spawn a new window once taken outside the window. Then that new window can be placed back onto it's original window, bringing back the taken off tabs. However, if you take off a tab from that new window, if the tab is the only tab appearing on that window, it will initially once again create a new window - but otherwise program will completely break during processing input messages, with assertions implying that the program is still trying to access a window that doesn't exist. The issue can be easily reproduced by simply adding a m_wndClient.EnableTearOff(); line in RibbonMDISample. We have created a video that more clearly shows the issue: https://statica.pl/pliki/n5/RibbonMDI_Tearoff.mp4 | |
|  | |
| agontarenko   Moderator Group   Joined: 25 March 2016 Status: Offline Points: 332 |  Post Options  Thanks(0)  Quote  Reply  Posted: 19 February 2025 at 10:27am | 
| Hello, To resolve your provblem you need to change 1. Base class to CXTPMDIFrameWndEx. class CMainFrame : public CXTPMDIFrameWndEx 2. Add virtual functions as below     virtual CXTPDockingPaneManager* GetDockingPaneManager(); virtual CXTPTabClientWnd* GetTabClientWnd(); CXTPDockingPaneManager* CMainFrame::GetDockingPaneManager() { return NULL; } CXTPTabClientWnd* CMainFrame::GetTabClientWnd() { return &m_wndClient; } 3. Add GetTabClientWnd()->Detach(); call to OnDestroy function void CMainFrame::OnDestroy() { // Save command bars state into the registry profile SaveCommandBars(_T("CommandBars")); CXTPMDIFrameWndEx::OnDestroy(); GetTabClientWnd()->Detach(); } 4. See please MDITabWindow and GUI_VisualStudio samples Regards, Artem Gontarenko | |
|  | |
| jw_statica   Groupie   Joined: 23 May 2018 Status: Offline Points: 36 |  Post Options  Thanks(0)  Quote  Reply  Posted: 20 February 2025 at 6:17am | 
| 
   Unfortunately the same crash happens in unmodified MDITabWindow and GUI_VisualStudio. They seem to have both of these overrides implemented. The crash can be easily reproduced in those examples the same way as shown in the RibbonMDI video.
    | |
|  | |
| agontarenko   Moderator Group   Joined: 25 March 2016 Status: Offline Points: 332 |  Post Options  Thanks(0)  Quote  Reply  Posted: 21 February 2025 at 5:48am | 
| Hello, What version of Windows and Vistual Studio you use? Regards, Artem Gontarenko | |
|  | |
| jw_statica   Groupie   Joined: 23 May 2018 Status: Offline Points: 36 |  Post Options  Thanks(0)  Quote  Reply  Posted: 21 February 2025 at 6:23am | 
| 
   Codejock Toolkit Pro version 24.1 Windows 11 Visual Studio 2022 17.13.0 Codejock was also recompiled with C++20 enabled | |
|  | |
| agontarenko   Moderator Group   Joined: 25 March 2016 Status: Offline Points: 332 |  Post Options  Thanks(1)  Quote  Reply  Posted: 24 February 2025 at 7:29am | 
| Hello, I've able to reproduce problem Regards, Artem Gontarenko | |
|  | |
| agontarenko   Moderator Group   Joined: 25 March 2016 Status: Offline Points: 332 |  Post Options  Thanks(0)  Quote  Reply  Posted: 25 February 2025 at 5:51am | 
| Hello, File "C:\Program Files (x86)\Codejock Software\MFC\Xtreme ToolkitPro v24.1.0\Source\CommandBars\XTPTabClientWnd.cpp" Replace line     pTearOffFrm->SetOwner(context.m_pCurrentFrame); with this    pTearOffFrm->SetOwner(AfxGetMainWnd()); and rebuild CJ Regards, Artem Gontarenko | |
|  | |
| jw_statica   Groupie   Joined: 23 May 2018 Status: Offline Points: 36 |  Post Options  Thanks(0)  Quote  Reply  Posted: 25 February 2025 at 6:37am | 
| 
   Thanks, the XTPTabClientWnd change fixed the issue and the program is no longer crashing.
    | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |