Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Tear off window causes crash on exit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tear off window causes crash on exit

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


Joined: 16 May 2007
Location: United States
Status: Offline
Points: 74
Post Options Post Options   Thanks (0) Thanks(0)   Quote rconn Quote  Post ReplyReply Direct Link To This Post Topic: Tear off window causes crash on exit
    Posted: 24 July 2022 at 4:12pm
Using Toolkit Pro 20.3, Visual Studio 2022, Windows 11.

When I enable tear off windows, tear one off, and then close the main client window the app will crash in CXTPTearOffFrame::DestroyWindow(). A bad pointer is returned from:

    CXTPTabClientWnd* pPrevTab = (CXTPTabClientWnd*)m_wndTabClient.m_lstPrevTab.GetHead();

If I close the tear off window first, then close the main client window I don't get the crash.

Anybody else seen this?  Is there a workaround?

Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2022 at 4:11am
Hello,

Unfortunately it is not clear what exactly is going wrong.
If it cannot be re-produced in any of our sample applications provided I would appreciate you sending a small code snippet or ideally a sample application so that we could debug it.

Regards,
Artem Gontarenko
Back to Top
jw_statica View Drop Down
Groupie
Groupie


Joined: 23 May 2018
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote jw_statica Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2022 at 3:35am
I have the same issue with ToolKitPro 22.0.0. I was testing the sample project RibbonResource. 
Steps:
1. In function CMainFrame::OnCreate add one line m_wndTabClient.EnableTearOff(). 
2. Open a few tabs.
3. Tear-off one of opened tabs.
4. Close application.
5. We have crash mentioned in topic CXTPTearOfFrame::DestroyWindow().
Back to Top
jw_statica View Drop Down
Groupie
Groupie


Joined: 23 May 2018
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote jw_statica Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2022 at 5:11am
Have you reproduced this issue?
Back to Top
xsensordev View Drop Down
Groupie
Groupie


Joined: 19 August 2021
Location: Canada
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote xsensordev Quote  Post ReplyReply Direct Link To This Post Posted: 20 December 2022 at 6:19pm
This may or may not work for you. It works for me as of Toolkit Pro 20.3.0

In CMainFrame::OnClose(), I call CXTPTabClientWnd::CloseAllTearOffFrames().

My CMainFrame's CXTPTabClientWnd member is _MTIClientWnd.


void CMainFrame::OnClose()
{
    if(_MTIClientWnd.GetItemCount() > 0)
        _MTIClientWnd.CloseAllTearOffFrames();

    _MTIClientWnd.Detach();

    CXTPMDIFrameWndEx::OnClose();
}
Back to Top
jw_statica View Drop Down
Groupie
Groupie


Joined: 23 May 2018
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote jw_statica Quote  Post ReplyReply Direct Link To This Post Posted: 21 December 2022 at 5:02am
It works for me too :-) Thank you for response ;)
Back to Top
xsensordev View Drop Down
Groupie
Groupie


Joined: 19 August 2021
Location: Canada
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote xsensordev Quote  Post ReplyReply Direct Link To This Post Posted: 23 December 2022 at 12:24pm
You're welcome, happy holidays!
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.203 seconds.