Print Page | Close Window

Lockup in TrackPopupMenu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=24210
Printed Date: 21 November 2024 at 11:14am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Lockup in TrackPopupMenu
Posted By: rdhd
Subject: Lockup in TrackPopupMenu
Date Posted: 16 September 2021 at 4:03pm
I have traced a lockup in our app to two things going on in CodeJock. We hare in CXTPCommandBars::TrackPopupMenu. It is calling CXTPPopupBar::PumPMessage. We get stuck with the GetMessage call in that code constantly getting a TTM_DEL message. When it gets the message, the code calls ::DispatchMessage. So far so good.

Except, the code ends up in CXTPToolTipContextToolTip::DelTool and it does this when we lock up

        PostMessage(TTM_DELTOOL, 0, reinterpret_cast<LPARAM>(lpToolInfo));

The result is that the PumpMessage code just keeps dispatch TTM_DELTOOL only to have another message posted right back to the message queue.

So how did I get into this state? On the context menu we have a flyout. And, we have a string in our string table that has value 65555 (0xffff). That becomes -1. As we move over the context menu, CJ will call OnToolHitTest for that item. But, CJ doesn't care that the value is -1 because the control has a tooltip on it.

Here is code down in CXTPCommandBar::OnToolHitTest:

    CString strTip = pControl->GetTooltip();
    if (strTip.GetLength() == 0)
        return -1;

It gets past that test and CXTPToolTipContext::FillInToolInfo is called. Then the stack unwinds to CXTPToolTipContext::FilterToolTipMessageHelper TTM_ADDTOOL is NOT called because nHit is -1. But, m_lastInfo is set to tiHit. Then we move onto a menu entry that is not a submenu and with an ID that is not -1. The FilterToolTipMessageHelper drops into the code that sends the TTM_ADDTOOL and the TTM_DELTOOL messages and in DelTool "lpToolInfo->uID and m_nToolTipBeingShownUid are both -1 and that causes the code to post TTM_DELTOOL again.

I'm thinking ... DelTool should never post that message when the uId is -1 since it never posts TTM_ADDTOOL when it is -1.



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