I was examining CXTPToolTipContext to see if I could find a clue to an issue we see every once in a while on some machines where the tooltip image I get for an HTML tooltip appears to be coming from the another control - usually the control next to, or near, the one the tip is being displayed for.
When SetVisibleTool is called I call Navigate. PumpMessage is called in a loop after calling Navigate until the ready state of the browser control is raised. Then I use the uId to get an image, which I save to disk and then use as the source in the html.
So I examined FilterToolTipMessageHelper for clues. I noticed SendMessage(TTM_DELTOOL, (LPARAM)&m_lastInfo) is sent to the tooltip. I looked at OnDelTool and I see that if the uId in the tool matches m_nToolTipBeingShownUid, the CXTPToolTipContextToolTip calls PostMessage(TTM_DELTOOL ...). So the SendMessage from the context is essentially turned into a PostMessage by the tooltip itself.
Then the SendMessage returns to the context and in the tip context I see this:
m_lastInfo = tiHit;
So isn't it possible that while still waiting for the ready state and pumping messages that the posted TTM_DELTOOL message will processed later than the context expects with the possibility that the uId no longer matches the original id the context intended to be used when SendMessage was called?
|