Locked MFC Feature Pack - LoadState

  • Sunday, April 29, 2012 8:10 AM
     
     

    Dear all,

    I have a MFC MDI application (using the new MFC Feature Pack), but I am facing a problem. The application has multiple dockable panes. I dock some of them in a tabbed layout. Whenever I close the application (the layout state is automatically saved in the registry). When I reopen the application, the state gets loaded from the registry, but the problem is that my dockable panes (especially the ones that were tabbed) are randomly docked, and some of them appear as duplicates!

    Please help me.
    Thank you :)

All Replies

  • Monday, April 30, 2012 9:19 AM
    Moderator
     
     Answered

    Hello,

    There may be the parent frame is hidden when you call the loadState.
    Please use code like the following to hide the miniframes for any hidden docking panes (this example is for the output window):

    // Hide invisible docking pane's miniframe:
    if (!m_wndOutput.IsVisible() && m_wndOutput.GetParentMiniFrame()->GetSafeHwnd() != NULL)
    {
    m_wndOutput.GetParentMiniFrame()->ShowWindow(SW_HIDE);
    }

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us