![]() |
PopupMenu - messages not routing correctl |
Post Reply
|
| Author | |
craig
Groupie
Joined: 11 August 2005 Location: United States Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Topic: PopupMenu - messages not routing correctlPosted: 09 June 2006 at 7:14pm |
|
I've create a CXTPPopupMenu with several controls on it.
I track it with CXTPCommandBars::TrackPopupMenu(pColorBar, 0, rcItem.left, rcItem.bottom, m_pMsgWnd); The controls such as a simple button are generating messages that are recieved by m_pMsgWnd, but any of the controls that use ON_XTP_EXECUTE don't receive any messages. How do I get my ON_XTP_EXECUTE messages to route to the parent window defined in m_pMsgWnd? Thanks, Craig |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 June 2006 at 9:27am |
|
Hello, 2 solutions: m_pMsgWnd must be such class CXTPCommandBarsSiteBase<CParentWndClass> or add virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult) UINT nID = (UINT)pNMHDR->idFrom; AFX_NOTIFY notify; return TBase::OnWndMsg(message, wParam, lParam, pResult); to your m_pMsgWnd class. |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
craig
Groupie
Joined: 11 August 2005 Location: United States Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 June 2006 at 1:50pm |
|
Thanks Oleg. The first method worked.
I tryed the second method too but it didn't work. In the return statement, what is TBase? My class derives from CWnd, so I tried changing the return statement to return CWnd::OnWndMsg(...) but the method appears to be virtual. The error I receive is: c:\vault\FreeWorldDesktop\FreeWorld\RgbaColorMenuGridItemWnd .cpp(65): error C2723: 'CRgbaColorMenuGridItemWnd::OnWndMsg' : 'virtual' storage-class specifier illegal on function definition I have it all working, so you don't have to reply. I just thought it might be helpful to catalog the alternatives so the next guy wouldn't have to bug you. :-) Thanks, Craig |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |