Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtDynamicBarSite::m_nBarListInMenusCmdID shows dynamic bar always greyed out Collapse All
Subject Author Date
Scott Moore Sep 11, 2008 - 3:21 PM

I have a single dynamic bar in my application:


        _serversCB = static_cast<CExtDynamicControlBar *> (CExtDynamicBarSite::BarAlloc(

            L"Servers",

            serversIcon,

            0,

            RUNTIME_CLASS(CExtDynamicControlBar)

            ));


which I am trying to show in a menu using this code:


    CExtDynamicBarSite::m_nBarListInMenusCmdID = ID_WINDOW_LIST;

    CExtDynamicBarSite::Install(this);


    POPUP "&Window"

    BEGIN

        MENUITEM "Window List",                 ID_WINDOW_LIST

    END


However, the name "Servers" does show up in the menu, but it’s always greyed out, even if I close the dynamic bar.  How do I fix this?


 


 

Scott Moore Sep 12, 2008 - 12:49 PM

Thank you, that was the problem.

Technical Support Sep 12, 2008 - 12:44 PM

We failed to reproduce the problem with the MDI_DynamicBars sample. We also tried to insert a new simple popup sub menu using that sample application:

    POPUP "&ZZZ"
    BEGIN
        MENUITEM "<< DYNAMIC BARS LIST >>",     ID_DYNAMIC_BARS_LIST
    END
As a result, the menu contains a list of dynamic control bars as it should. This is exactly as you did in your project and this menu is correct.

We suspect the problem may be with something else what is not discussed in your message. Please compare the OnCmdMsg() virtual method in the main frame class of the MDI_DynamicBars sample application with the same method in your project. This virtual method should first of all invoke the CExtDynamicBarSite::OnCmdMsg() method:
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
{
      if( CExtDynamicBarSite::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ) )
            return TRUE;
. . . 

Scott Moore Sep 11, 2008 - 3:22 PM

By the way, I am using prof ui 2.82.