Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTColorPopup now calling DestroyWindow
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTColorPopup now calling DestroyWindow

 Post Reply Post Reply
Author
Message
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 666
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: CXTColorPopup now calling DestroyWindow
    Posted: 24 February 2009 at 3:45am
You changed this code from v1211:
 
void CXTColorPopup::EndSelection(int nCurSel)
{
CXTPMouseMonitor::SetupHook(NULL);
OnEndSelection(nCurSel, m_callerParam);
PostMessage(WM_CLOSE);
}
 
to this code in v1300:
 
void CXTColorPopup::EndSelection(int nCurSel)
{
CXTPMouseMonitor::SetupHook(NULL);
OnEndSelection(nCurSel, m_callerParam);
DestroyWindow();
}
 
But the direct call to DestroyWindow makes my Color Popup crash!
 
A quick debug shows that the EndSelection is called from both CXTColorPopup::OnKillFocus and
from CXTColorSelectorCtrl::OnLButtonUp, making the second call fail.
 
-cpede
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 666
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 03 August 2009 at 3:54am
This is still a problem in v1310.
 
-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2009 at 12:48am
Hello,
 
We added flag now to prevent second call:
 
void CXTColorPopup::EndSelection(int nCurSel)
{
 m_bEndSelection = TRUE;
 CXTPMouseMonitor::SetupHook(NULL);
 OnEndSelection(nCurSel, m_callerParam);
 DestroyWindow();
}
void CXTColorPopup::OnKillFocus(CWnd* pNewWnd)
{
 CWnd::OnKillFocus(pNewWnd);
 if (!m_pColorDlg && !m_bEndSelection)
 {
  EndSelection(-1);
 }
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.125 seconds.