Print Page | Close Window

CXTColorPopup now calling DestroyWindow

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=13482
Printed Date: 12 December 2024 at 12:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTColorPopup now calling DestroyWindow
Posted By: cpede
Subject: CXTColorPopup now calling DestroyWindow
Date 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



Replies:
Posted By: cpede
Date 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++)


Posted By: Oleg
Date 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



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