Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Control execution context
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Control execution context

 Post Reply Post Reply
Author
Message
No.Regsz View Drop Down
Groupie
Groupie


Joined: 28 December 2008
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote No.Regsz Quote  Post ReplyReply Direct Link To This Post Topic: Control execution context
    Posted: 15 April 2011 at 7:21pm
I have a popup menu for a toolbar button. Similar to Office color picker.

I'd like to reuse the same popup for a split button inside a docking view.

I use the following method and have command handlers in both the document child view and the docking view content dialog:

void CMainFrame::TrackBookmarkPopup(int xPos, int yPos, CWnd *pWnd /*= NULL*/) {
  CXTPCommandBars::TrackPopupMenu(m_pBookmarkPopup, TPM_LEFTBUTTON, xPos, yPos, pWnd, NULL, pWnd);
}

When I use this method once - all commands start to dispatch through a passed docking view child dialog. Even if I open this popup from the toolbar with a docking view closed.

Am I doing it wrong way? Popup bar has changed commands target forever?
XTP 15.0.1
7 SP1
VS 2010 SP1 Beta
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: 18 April 2011 at 8:10am
Hi,

Yes, actually its true. After TrackPopupMenu,  pWnd will be set to m_pBookmarkPopup

Maybe solution is call with first pWnd = NULL and then reset owner

m_pBookmarkPopup->SetOwner(NULL);
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.172 seconds.