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 General Discussion » Debug assertion on basic commands Collapse All
Subject Author Date
Jonas Gauffin Aug 25, 2006 - 12:24 AM

I get an bug assertion on ID_VIEW_MENU when "g_CmdManager->SetBasicCommands(theApp.m_pszProfileName, statBasicCommands);" is called.

The basic commands:
static UINT statBasicCommands[] =
{
    //ID_FILE_NEW,
        //(PROJTYPE_MDI || !NODOCVIEW)
        //ID_FILE_OPEN,
        //ID_FILE_SAVE,
        //!NODOCVIEW
        ID_APP_EXIT,
        ID_APP_ABOUT,
        /*ID_EDIT_COPY,
        ID_EDIT_CUT,
        ID_EDIT_PASTE,
        ID_EDIT_UNDO, */
        //ID_VIEW_TOOLBAR,
        ID_VIEW_MENUBAR,
        ID_VIEW_STATUS_BAR,
        //TOOLBAR
        ID_VIEW_QUEUEBAR,
        ID_VIEW_AGENTBAR,
        ID_VIEW_CURRENTINQUIRY,
        ID_VIEW_MYINQUIRIES,
        //(CRecordView || CDaoRecordView || COleDBRecordView)
        //HELP
        0 // end of commands list
}; // statBasicCommands array

menubar creation:
    if(    !m_wndMenuBar.Create(
            NULL, // _T("Menu Bar"),
            this,
            ID_VIEW_MENUBAR,
            WS_CHILD|WS_VISIBLE
                |CBRS_TOP|CBRS_TOOLTIPS|CBRS_GRIPPER
                |CBRS_TOOLTIPS
                |CBRS_FLYBY
                |CBRS_SIZE_DYNAMIC
                |CBRS_HIDE_INPLACE
                )
        )
{
TRACE0("Failed to create menubar\n");
return -1; // failed to create
}

Jonas Gauffin Aug 25, 2006 - 2:28 AM

ok. thank you

Suhai Gyorgy Aug 25, 2006 - 2:04 AM

This can happen if the command manager doesn’t have that command identifier registered. Make sure you call
g_CmdManager->UpdateFromMenu( pApp->m_pszProfileName, IDR_MAINFRAME );
to register every identifier in the IDR_MAINFRAME menu, and if ID_VIEW_MENUBAR is in that menu,
it will get registered as well.