Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CMarkupStatic crashes when mouse moves
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CMarkupStatic crashes when mouse moves

 Post Reply Post Reply
Author
Message
BerntK View Drop Down
Groupie
Groupie
Avatar

Joined: 15 September 2008
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote BerntK Quote  Post ReplyReply Direct Link To This Post Topic: CMarkupStatic crashes when mouse moves
    Posted: 15 September 2008 at 11:26am
I use CMarkupStatic for displaying infotext for some records...
When I move through the records by keypress I update the CMarkupStatic by SetMarkupText("some XAML") for every record.

Problem: If I move the mouse across the CMarkupStatic window - while scolling though the records - the application crashes at the function:

CXTPMarkupObject* CXTPMarkupObject::GetValue(CXTPMarkupDependencyProperty* pProperty)

were the passed pProperty is invalid.

Callstack:

ToolkitPro1202vc80D.dll!CXTPMarkupObject::GetValue(CXTPMarkupDependencyProperty * pProperty=0x032c8250)  Zeile 701 + 0xe Bytes    C++
ToolkitPro1202vc80D.dll!CXTPMarkupStyle::GetBasedStyle()  Zeile 154 + 0xe Bytes    C++
ToolkitPro1202vc80D.dll!CXTPMarkupInputElement::AddStyleTriggers(CXTPMarkupStyle * pStyle=0x032f7228, CXTPMarkupDependencyProperty * pProperty=0x032c8588, CXTPMarkupObject * pNewValue=0x032c8530)  Zeile 480 + 0x8 Bytes    C++
ToolkitPro1202vc80D.dll!CXTPMarkupInputElement::FireTriggers(CXTPMarkupDependencyProperty * pProperty=0x032c8588, CXTPMarkupObject * pNewValue=0x032c8530)  Zeile 563 + 0x17 Bytes    C++
ToolkitPro1202vc80D.dll!CXTPMarkupFrameworkElement::OnPropertyChanged(CXTPMarkupDependencyProperty * pProperty=0x032c8588, CXTPMarkupObject * pOldValue=0x032c8ef0, CXTPMarkupObject * pNewValue=0x032c8530)  Zeile 411    C++
ToolkitPro1202vc80D.dll!CXTPMarkupTextBlock::OnPropertyChanged(CXTPMarkupDependencyProperty * pProperty=0x032c8588, CXTPMarkupObject * pOldValue=0x032c8ef0, CXTPMarkupObject * pNewValue=0x032c8530)  Zeile 298    C++
ToolkitPro1202vc80D.dll!CXTPMarkupObject::SetValue(CXTPMarkupDependencyProperty * pProperty=0x032c8588, CXTPMarkupObject * pValue=0x00000000)  Zeile 628 + 0x1b Bytes    C++
ToolkitPro1202vc80D.dll!CXTPMarkupInputElement::OnMouseLeave(CXTPMarkupMouseEventArgs * __formal=0x0012cf08)  Zeile 266    C++
ToolkitPro1202vc80D.dll!CXTPMarkupContext::HandleMouseEnter(CXTPMarkupInputElement * pMouseOver=0x032f9298, CPoint point={...})  Zeile 465 + 0x1c Bytes    C++
ToolkitPro1202vc80D.dll!CXTPMarkupContext::HandleMouseMove(CXTPMarkupUIElement * pUIElement=0x032d26d0, CPoint point={...})  Zeile 500    C++
ToolkitPro1202vc80D.dll!CXTPMarkupContext::OnWndMsg(CXTPMarkupUIElement * pUIElement=0x032d26d0, unsigned int message=512, unsigned int wParam=0, long lParam=11796582, long * pResult=0x0012d384)  Zeile 672    C++
Toolsd.dll!CMarkupStatic::OnWndMsg(unsigned int message=512, unsigned int wParam=0, long lParam=11796582, long * pResult=0x0012d384)  Zeile 79 + 0x28 Bytes    C++


If I exclude CMarkupStatic::OnWndMsg() no crashes (but also no handling of hyperlinks,...)

I also tried the MarkUpSample. I added a OnTimer function to update the text of the CMarkupStatic periodically every 200ms. Everthing is fine except when I move the mouse across the control. After some moves the hyperlink does not show the mouseover and when exiting the program it asserts.

tx for help,
Bernt

Back to Top
BerntK View Drop Down
Groupie
Groupie
Avatar

Joined: 15 September 2008
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote BerntK Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2008 at 3:20am
Hi,

Adding two lines to SetMarkupText("some XAML") methode solves the problem:


void CMarkupStatic::SetMarkupText(LPCSTR lpszMarkup)
{
    MARKUP_RELEASE(m_pUIElement);
    MARKUP_RELEASE(m_pMouseOver);
    m_pActiveElement = NULL;


    m_pUIElement = Parse(lpszMarkup);

    if (m_hWnd)
        Invalidate(FALSE);
}



Bernt
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.047 seconds.