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 » I'm getting an assert in OnSerializeState Collapse All
Subject Author Date
Timothy Anderson Feb 2, 2007 - 7:10 PM

    CExtCmdItem * pCmdItem = CmdGetPtr(nCmdId);
    ASSERT( pCmdItem != NULL );
    ASSERT( !(pCmdItem->StateIsBasic()) );
    ASSERT( !(pCmdItem->StateIsForceRarely()) );
    ASSERT( !(CExtCmdManager::IsSystemCommand(pCmdItem->m_nCmdID)) );
    pCmdItem->m_nUsageTickCount = nUsageTickCount;

My code was lifted directly from the MDI example. I could just ignore it in 2k3 but in 2k5 it gets really grumpy. The pCmdItem is null.

Timothy Anderson Feb 2, 2007 - 7:34 PM

// Inside OnCreate
VERIFY(g_CmdManager->ProfileSetup(pApp->m_pszProfileName, GetSafeHwnd()));

// Move these calls just below above instead of having too far down after a bunch of other windows were created
VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName, IDR_MAINFRAME));
VERIFY(g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName, IDR_MAINFRAME));
VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName, IDR_CELL_ALLMENU));