Hello.
>Part 1: We need more details about the problem. You are clicking on any command item on some popup menu. It’s closed and handler method is invoked, right? What’s wrong?
Will how to use be bad?
class CMainFrame : public CMuMdiFrame
, public CExtDynamicBarSite
{
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
:
:
:
:
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
if ( CNxfWinEngine::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo) == FALSE ){
return FALSE;
}
:
:
:
:
class CNxfWinEngine
{
// ----------------------------------------------------------------------------
// メンバー
public:
enum ECID
{
ECID_UNKNOW = 0, /// Unknow
ECID_CLICK = 1, ///
ECID_UPDATE_CMDUI = 2, ///
};
static BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
:
:
:
:
BOOL CNxfWinEngine::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
CCmdUI * pCmdUI;
pCmdUI = (CCmdUI *)pExtra;
if( nCode == CN_COMMAND && pExtra == NULL ){
return OnCommands( CNxfWinEngine::ECID_CLICK , nID );
}
else if( nCode == CN_UPDATE_COMMAND_UI ){
return OnCommands( CNxfWinEngine::ECID_UPDATE_CMDUI , nID , pCmdUI );
}
return TRUE;
}
BOOL CNxfWinEngine::OnCommands ( ECID eComIDType , UINT nID , CCmdUI * pCmdUI )
{
switch( nID ){
// ------------------------------------------------------------------------
// Ribbon Tab
// ------------------------------------------------------------------------
case IDM_RIBBON_TAB_HOME:
switch ( eComIDType ){
case ECID_CLICK:
OnRibbonTabHome();
break;
}
break;
case IDM_RIBBON_TAB_PANEL:
switch ( eComIDType ){
case ECID_CLICK:
OnRibbonTabPanel();
break;
}
break;