Print Page | Close Window

How to destroy CXTPPopupControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14121
Printed Date: 22 June 2025 at 4:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to destroy CXTPPopupControl
Posted By: eksubbot
Subject: How to destroy CXTPPopupControl
Date Posted: 23 April 2009 at 8:28am
Hello all,


I have a question related to CXTPPopupControl.
I create popup control  as CXTPPopupControl* pPopupControl = new CXTPPopupControl().
Should I release this memory manually if user presses close button or it will be deleted automatically?
Should I release this memory manually if we call pPopupControl ->Close()?

In help I see that CXTPPopupControl::Close method destroys a popup window but there is no information if CXTPPopupControl's destructor is called.

Thanks in advance.



Replies:
Posted By: znakeeye
Date Posted: 24 April 2009 at 3:04am
I believe this is correctly implemented in Samples\Controls\PopupControl.

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: terrym
Date Posted: 24 April 2009 at 3:24am
Originally posted by eksubbot eksubbot wrote:

Hello all,


I have a question related to CXTPPopupControl.
I create popup control  as CXTPPopupControl* pPopupControl = new CXTPPopupControl().
Should I release this memory manually if user presses close button or it will be deleted automatically?
Should I release this memory manually if we call pPopupControl ->Close()?

In help I see that CXTPPopupControl::Close method destroys a popup window but there is no information if CXTPPopupControl's destructor is called.

Thanks in advance.
 
We have OnPopUpControlNotifyt as below which is called and closes the popup control:
 

LRESULT CMainFrame::OnPopUpControlNotify( WPARAM wParam, LPARAM lParam )

{

if ( wParam == XTP_PCN_ITEMCLICK )

{

CXTPPopupItem *pItem = (CXTPPopupItem *)lParam;

ASSERT( pItem );

// get click id

int nID = pItem->GetID();

// close popup

pItem->GetPopupControl()->Close();

// was this a click ?

if ( nID == POPUP_CONTROL_HYPERLINK_BUY_NOW )

{

// yes, so open buy now page

OnActivateBuyNow();

}

}

m_PopupControl.OnNotify( wParam, lParam );

return TRUE;

}



-------------
Thank you,
Terry Mancey

email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey



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