Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to destroy CXTPPopupControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to destroy CXTPPopupControl

 Post Reply Post Reply
Author
Message
eksubbot View Drop Down
Newbie
Newbie


Joined: 23 April 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote eksubbot Quote  Post ReplyReply Direct Link To This Post Topic: How to destroy CXTPPopupControl
    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.
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2009 at 3:04am
I believe this is correctly implemented in Samples\Controls\PopupControl.
PokerMemento - http://www.pokermemento.com/
Back to Top
terrym View Drop Down
Senior Member
Senior Member


Joined: 13 April 2007
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote terrym Quote  Post ReplyReply Direct Link To This Post 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
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.