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 » CExtControlToolbar with Combobox has a fix text length Collapse All
Subject Author Date
Timo Stripf Sep 1, 2009 - 11:39 AM

How i can change the char length in a combobox, which is located in a toolbar? Prof-UIS Studio have the same Problem, only the avaible space is used to write text into. Text which is longer than the Combobox himself is not possible. LimitText for the Combobox, InnerEditControl are not working. Any solutions for this problem, without complete rewrite?

Technical Support Sep 2, 2009 - 1:00 PM

You should create your combo box window with an enough large width to fit any selected string in it. So, you should measure all the strings or, at least, the maximum lengthy string. First of all, you need to use appropriate font:

CFont * pFont = CFont::FromHandle( (HFONT)::GetStockObject( DEFAULT_GUI_FONT ) );

The following code measures string size in pixels:
CExtString str = _T("some string in combo box");
CWindowDC dcDesktop( NULL );
CSize sizeOfStr = CExtPaintManager::stat_CalcTextDimension( dcDesktop, *pFont, str, DT_SINGLELINE|DT_LEFT|DT_NOPREFIX ).Size();
INT nWidthOfStr = sizeOfStr.cx;

But combo box also have drop-down button and borders. So, the combo box width can be computed as:
INT nWidthOfComboBox = nWidthOfStr + 6 + ::GetSystemMetrics( SM_CXVSCROLL );


Timo Stripf Sep 2, 2009 - 2:55 PM

Sorry, but this is not the answer, which i have hoped to get. I need the Combobox like all other tools have it (for example firefox or the default combobox control [MFC]: http://clip2net.com/clip/m7085/1251923850-clip-2kb.png). When i write text into the combobox edit control, than i want that the text not stopped on the end of the control space. Why is this not supported by the CExtComboBox control in a Toolbar?

Technical Support Sep 3, 2009 - 10:17 AM

The ProfStudio sample application has five combo boxes and one editor control created as children of different toolbar windows inside the main frame window. All these windows have non-scrollable editing behavior and you cannot enter text wider then editor. Here are the properties of the CMainFrame class representing five combo boxes and one editor:

 CExtComboBox
            m_wndComboSolutionCfg,
            m_wndComboDlProgram,
            m_wndComboDlThread,
            m_wndComboDlStackFrame,
            m_wndComboWebLoaction;
            ;
      CExtEdit m_wndEditFindText;

Even if you make them CComboBox and CEdit type, then they will behave exactly the same. Why? We simply created combo boxes without the CBS_AUTOHSCROLL style and editor without the ES_AUTOHSCROLL style. We added these styles into creation code for all these combo boxes and editor and all they become editable with scrolling. Please update the source code for the CMainFrame::OnCreate() method in the ProfStudio sample application:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
      // turn off menu expanding
      CExtPopupMenuWnd::g_bMenuExpanding = false;
      CExtPopupMenuWnd::g_bMenuHighlightRarely = false;

      if( CExtNCW < CMDIFrameWnd > :: OnCreate( lpCreateStruct ) == -1 )
            return -1;

CProfStudioSplashWnd _splash( this, IDB_BITMAP_SPLASH );

      _splash.SetStatusText(
            _T("Initializing the Command Manager ...")
            );
      
CWinApp * pApp = ::AfxGetApp();
      ASSERT( pApp != NULL );
      ASSERT( pApp->m_pszRegistryKey != NULL );
      ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
      ASSERT( pApp->m_pszProfileName != NULL );
      ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );

      ASSERT( pApp->m_pszProfileName != NULL );
      g_CmdManager->ProfileSetup(
            pApp->m_pszProfileName,
            GetSafeHwnd()
            );
      VERIFY(
            g_CmdManager->UpdateFromMenu(
                  pApp->m_pszProfileName,
                  IDR_MAINFRAME
                  )
            );
      VERIFY(
            g_CmdManager->UpdateFromMenu(
                  pApp->m_pszProfileName,
                  IDR_PROFSTUDIOTYPE
                  )
            );
      VERIFY(
            g_CmdManager->UpdateFromMenu(
                  pApp->m_pszProfileName,
                  IDR_MENU_HELPER_ITEM_TEXTS
                  )
            );
      VERIFY(
            g_CmdManager->UpdateFromMenu(
                  pApp->m_pszProfileName,
                  IDR_MENU_CW_SORT
                  )
            );
      VERIFY(
            g_CmdManager->UpdateFromToolBar(
                  pApp->m_pszProfileName,
                  IDR_TOOLBAR_HELPER_ICONS
                  )
            );
      VERIFY(
            g_CmdManager->UpdateFromMenu(
                  pApp->m_pszProfileName,
                  IDR_MENU_PENDING_CHECKINGS_OPTIONS
                  )
            );
      VERIFY(
            g_CmdManager->UpdateFromToolBar(
                  pApp->m_pszProfileName,
                  IDR_TOOLBAR_HELPER_ICONS_2
                  )
            );

static struct
{
      UINT m_nCmdID;
      LPCTSTR m_sToolbarText;
} arrToolbarCmdTexts[] =
{
      { ID_PENDING_CHECKINGS_CHECK_IN, _T("&Check In") },
      { ID_PENDING_CHECKINGS_COMMENTS, _T("Co&mments") },
      { ID_BPDLG_NEW, _T("New") },
      { ID_BPDLG_COLUMNS, _T("Columns") },
};
INT i;
      for( i = 0; i<sizeof(arrToolbarCmdTexts)/(sizeof(arrToolbarCmdTexts[0])); i++ )
      {
            CExtCmdItem * pCmdItem =
                  g_CmdManager->CmdGetPtr(
                        pApp->m_pszProfileName,
                        arrToolbarCmdTexts[i].m_nCmdID
                        );
            ASSERT( pCmdItem != NULL );
            pCmdItem->m_sToolbarText = 
                  arrToolbarCmdTexts[i].m_sToolbarText;
      }
      
static struct
{
      UINT m_nCmdID;
} arrCmdsToRegister[] =
{
      { ID_OBJECT_BROWSER_BROWSE_COMBOBOX },
      { ID_OBJECT_BROWSER_CUSTOMIZE },
};
      for( i=0; i<sizeof(arrCmdsToRegister)/(sizeof(arrCmdsToRegister[0])); i++ )
      {
            ASSERT(
                  !g_CmdManager->CmdIsRegistered(
                        pApp->m_pszProfileName,
                        arrCmdsToRegister[i].m_nCmdID
                        )
                  );
            CExtCmdItem * pCmdItem =
                  g_CmdManager->CmdAllocPtr(
                        pApp->m_pszProfileName,
                        arrCmdsToRegister[i].m_nCmdID
                        );
            ASSERT( pCmdItem != NULL );
            ASSERT( pCmdItem->m_nCmdID == arrCmdsToRegister[i].m_nCmdID );
            pCmdItem;
      }

      _splash.SetStatusText(
            _T("Creating toolbars ...")
            );

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

      if( !m_wndToolBarStandard.Create(
                  _T("Standard"),
                  this,
                  AFX_IDW_TOOLBAR
                  )
            ||
            !m_wndToolBarStandard.LoadToolBar(IDR_MAINFRAME)
            )
      {
            TRACE0("Failed to create toolbar\n");
            return -1;      // fail to create
      }

      if( !m_wndComboSolutionCfg.Create(
                  WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN|CBS_AUTOHSCROLL,
                  CRect(0,0,100,200),
                  &m_wndToolBarStandard,
                  ID_SOLUTION_CONFIGURATION_COMBO
                  )
            )
      {
            TRACE0("Failed to create m_wndComboSolutionCfg\n");
            return -1;      // fail to create
      }
      VERIFY(
            m_wndToolBarStandard.SetButtonCtrl(
                  m_wndToolBarStandard.CommandToIndex(ID_SOLUTION_CONFIGURATION_COMBO),
                  &m_wndComboSolutionCfg
                  )
            );
      m_wndComboSolutionCfg.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndComboSolutionCfg.SetItemHeight(
            -1,
            m_wndComboSolutionCfg.GetItemHeight(-1) - 1
            );
      m_wndComboSolutionCfg.AddString( _T("Win32 Debug") );
      m_wndComboSolutionCfg.AddString( _T("Win32 Release") );
      m_wndComboSolutionCfg.AddString( _T("Win32 Unicode Debug") );
      m_wndComboSolutionCfg.AddString( _T("Win32 Unicode Release") );
      m_wndComboSolutionCfg.SetCurSel( 0 );

      if( !m_wndEditFindText.Create(
                  WS_CHILD|WS_VISIBLE|ES_LEFT|ES_AUTOHSCROLL,
                  CRect(0,0,180,17),
                  &m_wndToolBarStandard,
                  ID_EDIT_FIND
                  )
            )
      {
            TRACE0("Failed to create ID_EDIT_FIND\n");
            return -1;      // fail to create
      }
      VERIFY(
            m_wndToolBarStandard.SetButtonCtrl(
                  m_wndToolBarStandard.CommandToIndex(ID_EDIT_FIND),
                  &m_wndEditFindText
                  )
            );
      m_wndToolBarStandard.GetButton(
            m_wndToolBarStandard.CommandToIndex(ID_EDIT_FIND)
            ) -> SetCtrlVisibleVertically( TRUE );
      m_wndEditFindText.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );

      if(         (! m_wndToolBarUiLook.Create( NULL, this, ID_VIEW_UI_LOOK_BAR ) )
            ||    (! m_wndToolBarUiLook.ThemeSwitcherInit() )
            )
      {
            TRACE0("Failed to create m_wndToolBarUiLook\n");
            return -1;      // fail to create
      }
      
static const UINT arrDebugTbBtns[] =
{
      ID_DEBUG_START,
      ID_DEBUG_BREAK_ALL,
      ID_DEBUG_STOP_DEBUGGING,
      ID_DEBUG_RESTART,
      ID_SEPARATOR,
      ID_DEBUG_SHOW_NEXT_STATMENT,
      ID_DEBUG_STEP_INTO,
      ID_DEBUG_STEP_OVER,
      ID_DEBUG_STEP_OUT,
};
      if( !m_wndToolBarDebug.Create(
                  _T("Debug"),
                  this,
                  ID_VIEW_TOOLBAR_DEBUG
                  )
            || !m_wndToolBarDebug.SetButtons( arrDebugTbBtns, sizeof(arrDebugTbBtns)/sizeof(arrDebugTbBtns[0]) )
            || !m_wndToolBarDebug.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarDebug\n");
            return -1;      // fail to create
      }
      

static const UINT arrBuildTbBtns[] =
{
      ID_BUILD_SELECTION,
      ID_BUILD_SOLUTION,
      ID_SEPARATOR,
      ID_BUILD_CANCEL,
};
      if( !m_wndToolBarBuild.Create(
                  _T("Build"),
                  this,
                  ID_VIEW_TOOLBAR_BUILD
                  )
            || !m_wndToolBarBuild.SetButtons( arrBuildTbBtns, sizeof(arrBuildTbBtns)/sizeof(arrBuildTbBtns[0]) )
            || !m_wndToolBarBuild.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarBuild\n");
            return -1;      // fail to create
      }

static const UINT arrTextEditorTbBtns[] =
{
      ID_TE_PARAMETER_INFO,
      ID_TE_QUICK_INFO,
      ID_TE_COMPLETE_WORD,
      ID_SEPARATOR,
      ID_EDIT_ADVANCED_LINE_INDENT,
      ID_EDIT_ADVANCED_LINE_UNINDENT,
      ID_SEPARATOR,
      ID_TE_SELECTION_COMMENT,
      ID_TE_SELECTION_UNCOMMENT,
      ID_EDIT_BOOKMARK_TOGGLE,
      ID_EDIT_BOOKMARK_NEXT,
      ID_EDIT_BOOKMARK_PREVIOUSE,
      ID_EDIT_BOOKMARK_CLEAR,
};
      if( !m_wndToolBarTextEditor.Create(
                  _T("Text Editor"),
                  this,
                  ID_VIEW_TOOLBAR_TE
                  )
            || !m_wndToolBarTextEditor.SetButtons( arrTextEditorTbBtns, sizeof(arrTextEditorTbBtns)/sizeof(arrTextEditorTbBtns[0]) )
            || !m_wndToolBarTextEditor.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarTextEditor\n");
            return -1;      // fail to create
      }

static const UINT arrSourceControlTbBtns[] =
{
      ID_SOURCE_CONTROL_CHANGE,
      ID_SEPARATOR,
      ID_SOURCE_CONTROL_GET_LATEST_VERSION,
      ID_SOURCE_CONTROL_GET,
      ID_SOURCE_CONTROL_CHECK_OUT,
      ID_SOURCE_CONTROL_CHECK_IN,
      ID_SOURCE_CONTROL_UNDO_CHECK_OUT,
      ID_SOURCE_CONTROL_HISTORY,
      ID_SEPARATOR,
      ID_SOURCE_CONTROL_SHARE,
      ID_SOURCE_CONTROL_COMPARE_VERSIONS,
      ID_SOURCE_CONTROL_PROPERTIES,
      ID_SEPARATOR,
      ID_SOURCE_CONTROL_MANAGER,
      ID_SOURCE_CONTROL_REFRESH_STATUS
};
      if( !m_wndToolBarSourceControl.Create(
                  _T("Source Control"),
                  this,
                  ID_VIEW_TOOLBAR_SOURCE_CONTROL
                  )
            || !m_wndToolBarSourceControl.SetButtons( arrSourceControlTbBtns, sizeof(arrSourceControlTbBtns)/sizeof(arrSourceControlTbBtns[0]) )
            || !m_wndToolBarSourceControl.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarSourceControl\n");
            return -1;      // fail to create
      }

static const UINT arrDataDesignTbBtns[] =
{
      ID_DS_GENERATE_DATA_SET,
      ID_DS_PREVIEW_DATA,
};
      if( !m_wndToolBarDataDesign.Create(
                  _T("Data Design"),
                  this,
                  ID_VIEW_TOOLBAR_DATA_DESIGN
                  )
            || !m_wndToolBarDataDesign.SetButtons( arrDataDesignTbBtns, sizeof(arrDataDesignTbBtns)/sizeof(arrDataDesignTbBtns[0]) )
            || !m_wndToolBarDataDesign.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarDataDesign\n");
            return -1;      // fail to create
      }

static const UINT arrDebugLocationTbBtns[] =
{
      ID_DL_PROGRAM,
      ID_DL_THREAD,
      ID_DL_STACK_FRAME,
};
      if( !m_wndToolBarDebugLocation.Create(
                  _T("Debug Location"),
                  this,
                  ID_VIEW_TOOLBAR_DEBUG_LOCATION
                  )
            || !m_wndToolBarDebugLocation.SetButtons( arrDebugLocationTbBtns, sizeof(arrDebugLocationTbBtns)/sizeof(arrDebugLocationTbBtns[0]) )
            || !m_wndToolBarDebugLocation.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarDebugLocation\n");
            return -1;      // fail to create
      }
      
      if( !m_wndComboDlProgram.Create(
                  WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN|CBS_AUTOHSCROLL,
                  CRect(0,0,150,200),
                  &m_wndToolBarDebugLocation,
                  ID_DL_PROGRAM
                  )
            )
      {
            TRACE0("Failed to create ID_DL_PROGRAM\n");
            return -1;      // fail to create
      }
      VERIFY(
            m_wndToolBarDebugLocation.SetButtonCtrl(
                  m_wndToolBarDebugLocation.CommandToIndex(ID_DL_PROGRAM),
                  &m_wndComboDlProgram
                  )
            );
      m_wndComboDlProgram.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndComboDlProgram.SetItemHeight(
            -1,
            m_wndComboDlProgram.GetItemHeight(-1) - 1
            );

      if( !m_wndComboDlThread.Create(
                  WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN|CBS_AUTOHSCROLL,
                  CRect(0,0,120,200),
                  &m_wndToolBarDebugLocation,
                  ID_DL_THREAD
                  )
            )
      {
            TRACE0("Failed to create ID_DL_THREAD\n");
            return -1;      // fail to create
      }
      VERIFY(
            m_wndToolBarDebugLocation.SetButtonCtrl(
                  m_wndToolBarDebugLocation.CommandToIndex(ID_DL_THREAD),
                  &m_wndComboDlThread
                  )
            );
      m_wndComboDlThread.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndComboDlThread.SetItemHeight(
            -1,
            m_wndComboDlThread.GetItemHeight(-1) - 1
            );

      if( !m_wndComboDlStackFrame.Create(
                  WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN|CBS_AUTOHSCROLL,
                  CRect(0,0,200,200),
                  &m_wndToolBarDebugLocation,
                  ID_DL_STACK_FRAME
                  )
            )
      {
            TRACE0("Failed to create ID_DL_STACK_FRAME\n");
            return -1;      // fail to create
      }
      VERIFY(
            m_wndToolBarDebugLocation.SetButtonCtrl(
                  m_wndToolBarDebugLocation.CommandToIndex(ID_DL_STACK_FRAME),
                  &m_wndComboDlStackFrame
                  )
            );
      m_wndComboDlStackFrame.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndComboDlStackFrame.SetItemHeight(
            -1,
            m_wndComboDlStackFrame.GetItemHeight(-1) - 1
            );

static const UINT arrXmlDataTbBtns[] =
{
      ID_XML_CREATE_SCHEMA,
};
      if( !m_wndToolBarXmlData.Create(
                  _T("XML Data"),
                  this,
                  ID_VIEW_TOOLBAR_XML_DATA
                  )
            || !m_wndToolBarXmlData.SetButtons( arrXmlDataTbBtns, sizeof(arrXmlDataTbBtns)/sizeof(arrXmlDataTbBtns[0]) )
            || !m_wndToolBarXmlData.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarXmlData\n");
            return -1;      // fail to create
      }

static const UINT arrXmlSchemaTbBtns[] =
{
      ID_XML_EDIT_KEY,
      ID_XML_EDIT_RELATION,
      ID_XML_MAKE_TYPE_GLOBAL,
      ID_XML_PREVIEW_DATA_SET,
};
      if( !m_wndToolBarXmlSchema.Create(
                  _T("XML Schema"),
                  this,
                  ID_VIEW_TOOLBAR_XML_SCHEMA
                  )
            || !m_wndToolBarXmlSchema.SetButtons( arrXmlSchemaTbBtns, sizeof(arrXmlSchemaTbBtns)/sizeof(arrXmlSchemaTbBtns[0]) )
            || !m_wndToolBarXmlSchema.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarXmlSchema\n");
            return -1;      // fail to create
      }

static const UINT arrQueryTbBtns[] =
{
      ID_QUERY_SHOW_PANES_DIAGRAM,
      ID_QUERY_SHOW_PANES_GRID,
      ID_QUERY_SHOW_PANES_SQL,
      ID_QUERY_SHOW_PANES_RESULTS,
      ID_SEPARATOR,
      ID_QUERY_RUN,
      ID_QUERY_VERIFY_SYNTAX,
      ID_SEPARATOR,
      ID_QUERY_SORT_ASCENDING,
      ID_QUERY_SORT_DESCENDING,
      ID_QUERY_REMOVE_FILTER,
      ID_SEPARATOR,
      ID_QUERY_GROUP_BY,
      ID_SEPARATOR,
      ID_QUERY_ADD_TABLE_VIEW
};
      if( !m_wndToolBarQuery.Create(
                  _T("Query"),
                  this,
                  ID_VIEW_TOOLBAR_QUERY
                  )
            || !m_wndToolBarQuery.SetButtons( arrQueryTbBtns, sizeof(arrQueryTbBtns)/sizeof(arrQueryTbBtns[0]) )
            || !m_wndToolBarQuery.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarQuery\n");
            return -1;      // fail to create
      }

static const UINT arrWebTbBtns[] =
{
      ID_WEB_BACKWARD,
      ID_WEB_NAVIGATE_FORWARD,
      ID_WEB_STOP_BROWSER,
      ID_WEB_REFRESH_BROWSER,
      ID_WEB_HOME,
      ID_SEPARATOR,
      ID_WEB_SEARCH,
      ID_WEB_FAVORITES,
      ID_WEB_ADD_TO_FAVORITES,
      ID_SEPARATOR,
      ID_WEB_URL,
      ID_SEPARATOR,
      ID_WEB_SYNC_CONTEMTS,
      ID_WEB_PREVIOUSE_TOPIC,
      ID_WEB_NEXT_TOPIC,
      ID_SEPARATOR,
      ID_WEB_TEXT_SIZE,
};
      if( !m_wndToolBarWeb.Create(
                  _T("Web"),
                  this,
                  ID_VIEW_TOOLBAR_WEB
                  )
            || !m_wndToolBarWeb.SetButtons( arrWebTbBtns, sizeof(arrWebTbBtns)/sizeof(arrWebTbBtns[0]) )
            || !m_wndToolBarWeb.InitContentExpandButton()
            )
      {
            TRACE0("Failed to create m_wndToolBarWeb\n");
            return -1;      // fail to create
      }

      if( !m_wndComboWebLoaction.Create(
                  WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN|CBS_AUTOHSCROLL,
                  CRect(0,0,300,200),
                  &m_wndToolBarWeb,
                  ID_WEB_URL
                  )
            )
      {
            TRACE0("Failed to create ID_WEB_URL\n");
            return -1;      // fail to create
      }
      VERIFY(
            m_wndToolBarWeb.SetButtonCtrl(
                  m_wndToolBarWeb.CommandToIndex(ID_WEB_URL),
                  &m_wndComboWebLoaction
                  )
            );
      m_wndComboWebLoaction.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndComboWebLoaction.SetItemHeight(
            -1,
            m_wndComboWebLoaction.GetItemHeight(-1) - 1
            );


CExtCmdProfile * pProfile =
            g_CmdManager->ProfileGetPtr( pApp->m_pszProfileName );
      ASSERT( pProfile != NULL );
POSITION posCmd = pProfile->m_cmds.GetStartPosition();
      for( ; posCmd != NULL; )
      {
            UINT nID;
            CExtCmdItem * pCmdItem = NULL;
            pProfile->m_cmds.GetNextAssoc( posCmd, nID, pCmdItem );
            ASSERT( pCmdItem != NULL );
            if( pCmdItem->m_sTipTool.IsEmpty()
                  || pCmdItem->m_sTipStatus.IsEmpty()
                  )
            {
                  CString sTip;
                  if( !pCmdItem->m_sMenuText.IsEmpty() )
                        sTip = (LPCTSTR)pCmdItem->m_sMenuText;
                  else if( !pCmdItem->m_sToolbarText.IsEmpty() )
                        sTip = (LPCTSTR)pCmdItem->m_sToolbarText;
                  if( !sTip.IsEmpty() )
                  {
                        if( pCmdItem->m_sTipTool.IsEmpty() )
                              pCmdItem->m_sTipTool = sTip;
                        if( pCmdItem->m_sTipStatus.IsEmpty() )
                              pCmdItem->m_sTipStatus = sTip;
                  }
            }
      }

      _splash.SetStatusText(
            _T("Creating dockable panels ...")
            );

      if(   !m_wndSolutionExplorerBar.Create(
                        _T("Solution Explorer"),
                        this,
                        ID_VIEW_BAR_SE
                        )
            || !m_wndSolutionExplorerChild.Create(
                        CProfStudioSolutionExplorer::IDD,
                        &m_wndSolutionExplorerBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_SE\n");
            return -1;      // fail to create
      }

      if(   !m_wndResourceViewBar.Create(
                        _T("Resource View"),
                        this,
                        ID_VIEW_BAR_RESOURCE_VIEW
                        )
            || !m_wndResourceViewChild.Create(
                        WS_CHILD|WS_VISIBLE
                              |TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS
                              |TVS_INFOTIP|TVS_SHOWSELALWAYS
                              ,
                        CRect(0,0,0,0),
                        &m_wndResourceViewBar,
                        ID_VIEW_BAR_RESOURCE_VIEW
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_RESOURCE_VIEW\n");
            return -1;      // fail to create
      }
CProfStudioThinFrame * pWndThinFrame = new CProfStudioThinFrame;
      if( !pWndThinFrame->CreateDynamicThinFrame(&m_wndResourceViewChild) )
      {
            TRACE0("Failed to create thin frame for ID_VIEW_BAR_RESOURCE_VIEW\n");
            return -1;      // fail to create
      }
      m_wndResourceViewChild.InitResourceViewTree();

      if(   !m_wndClassViewBar.Create(
                        _T("Class View"),
                        this,
                        ID_VIEW_BAR_CLASS_VIEW
                        )
            || !m_wndClassViewChild.Create(
                        CProfStudioClassView::IDD,
                        &m_wndClassViewBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_CLASS_VIEW\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndServerExplorerBar.Create(
                        _T("Server Explorer"),
                        this,
                        ID_VIEW_BAR_SRV_EXPLORER
                        )
            || !m_wndServerExplorerChild.Create(
                        CProfStudioServerExplorer::IDD,
                        &m_wndServerExplorerBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_SRV_EXPLORER\n");
            return -1;      // fail to create
      }

      if(         (! m_wndPropertiesBar.Create(
                        _T("Properties"),
                        this,
                        ID_VIEW_BAR_PROPERTIES
                        ) )
#if (defined  __EXT_MFC_NO_PROPERTYGRIDWND)
            ||    (! m_wndPropertiesChild.Create(
                        CProfStudioProperties::IDD,
                        &m_wndPropertiesBar
                        ) )
#else // (defined  __EXT_MFC_NO_PROPERTYGRIDWND)
            ||    (! m_wndPGC.Create(
                        &m_wndPropertiesBar
                        ) )
#endif // else from (defined  __EXT_MFC_NO_PROPERTYGRIDWND)
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_PROPERTIES\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndToolboxBar.Create(
                        _T("Toolbox"),
                        this,
                        ID_VIEW_BAR_TOOLBOX
                        )
            || !m_wndToolboxChild.Create(
                        &m_wndToolboxBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_TOOLBOX\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndPendingCheckingsBar.Create(
                        _T("Pending Checkings"),
                        this,
                        ID_VIEW_BAR_PENDING_CHECKINGS
                        )
            || !m_wndPendingCheckingsChild.Create(
                        CProfStudioPendingCheckingsView::IDD,
                        &m_wndPendingCheckingsBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_PENDING_CHECKINGS\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndWebBrowserBar.Create(
                        _T("Web Browser"),
                        this,
                        ID_VIEW_BAR_WEB_BROWSER
                        )
            || !m_wndWebBrowserChild.Create(
                        &m_wndWebBrowserBar
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndWebBrowserChild
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_WEB_BROWSER\n");
            return -1;      // fail to create
      }
      m_wndWebBrowserChild.NavigateResourceID(
            ID_WEB_BROWSER_PAGE
            );
      
      if(   !m_wndMacroExplorerBar.Create(
                        _T("Macro Explorer"),
                        this,
                        ID_VIEW_BAR_MACRO_EXPLORER
                        )
            || !m_wndMacroExplorerChild.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |TVS_HASLINES|TVS_HASBUTTONS|TVS_INFOTIP
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndMacroExplorerBar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndMacroExplorerChild
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_MACRO_EXPLORER\n");
            return -1;      // fail to create
      }
      m_wndMacroExplorerChild.InitMacroExplorerTree();
      
      if(   !m_wndObjectBrowserBar.Create(
                        _T("Object Browser"),
                        this,
                        ID_VIEW_BAR_OBJECT_BROWSER
                        )
            || !m_wndObjectBrowserChild.Create(
                        CProfStudioObjectBrowserView::IDD,
                        &m_wndObjectBrowserBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_OBJECT_BROWSER\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndDocumentOutlineBar.Create(
                        _T("Document Outline"),
                        this,
                        ID_VIEW_BAR_DOCUMENT_OUTLINE
                        )
            || !m_wndDocumentOutlineChild.Create(
                        CProfStudioNoItemsToShowWnd::IDD,
                        &m_wndDocumentOutlineBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_DOCUMENT_OUTLINE\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndTaskListBar.Create(
                        _T("Task List"),
                        this,
                        ID_VIEW_BAR_TASK_LIST
                        )
            || !m_wndTaskListChild.Create(
                        &m_wndTaskListBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_TASK_LIST\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndCommandWindowBar.Create(
                        _T("Command Window"),
                        this,
                        ID_VIEW_BAR_COMMAND_WINDOW
                        )
            || !m_wndCommandWindowChild.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |ES_MULTILINE|ES_LEFT|ES_NOHIDESEL|ES_WANTRETURN
                              |ES_AUTOHSCROLL|ES_AUTOVSCROLL
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndCommandWindowBar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndCommandWindowChild
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_COMMAND_WINDOW\n");
            return -1;      // fail to create
      }
      m_wndCommandWindowChild.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndCommandWindowChild.SetWindowText(
            _T(">\r\n")
            _T(">\r\n")
            _T(">")
            );
      m_wndCommandWindowChild.SetSel( -1, -1 );
      
      if(   !m_wndOutputBar.Create(
                        _T("Output"),
                        this,
                        ID_VIEW_BAR_OUTPUT
                        )
            || !m_wndOutputChild.Create(
                        CProfStudioOutputView::IDD,
                        &m_wndOutputBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_OUTPUT\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndFindResults1Bar.Create(
                        _T("Find Results 1"),
                        this,
                        ID_VIEW_BAR_FIND_RESULTS_1
                        )
            || !m_wndFindResults1Child.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |ES_MULTILINE|ES_LEFT|ES_NOHIDESEL|ES_WANTRETURN
                              |ES_AUTOHSCROLL|ES_AUTOVSCROLL
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndFindResults1Bar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndFindResults1Child
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_FIND_RESULTS_1\n");
            return -1;      // fail to create
      }
      m_wndFindResults1Child.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndFindResults1Child.SetWindowText(
            _T("Find all \"BEGIN_MESSAGE_MAP\", Subfolders, Find Results 1, Current Project: testdlg.vcproj, \"*.*\"\r\n")
            _T("C:\\MyFolder\\MyDlg.cpp(40):BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)\r\n")
            _T("C:\\MyFolder\\MyDlg.cpp(59):BEGIN_MESSAGE_MAP(CMyDlg, CDialog)\r\n")
            _T("C:\\MyFolder\\testdlg.cpp(15):BEGIN_MESSAGE_MAP(CMyApp, CWinApp)\r\n")
            _T("Total found: 3    Matching files: 2    Total files searched: 10\r\n")
            );
      m_wndFindResults1Child.SetSel( -1, -1 );
      
      if(   !m_wndFindResults2Bar.Create(
                        _T("Find Results 2"),
                        this,
                        ID_VIEW_BAR_FIND_RESULTS_2
                        )
            || !m_wndFindResults2Child.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |ES_MULTILINE|ES_LEFT|ES_NOHIDESEL|ES_WANTRETURN
                              |ES_AUTOHSCROLL|ES_AUTOVSCROLL
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndFindResults2Bar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndFindResults2Child
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_FIND_RESULTS_2\n");
            return -1;      // fail to create
      }
      m_wndFindResults2Child.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndFindResults2Child.SetWindowText(
            _T("Find all \"CString\", Subfolders, Find Results 1, Current Project: testdlg.vcproj, \"*.*\"\r\n")
            _T("C:\\MyFolder\\MyDlg.cpp(82):          CString strAboutMenu;\r\n")
            _T("C:\\MyFolder\\stdafx.h(29):#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS     // some CString constructors will be explicit\r\n")
            _T("Total found: 2    Matching files: 2    Total files searched: 10\r\n")
            );
      m_wndFindResults2Child.SetSel( -1, -1 );
      
      if(   !m_wndFindSymbolResultsBar.Create(
                        _T("Find Symbol Results"),
                        this,
                        ID_VIEW_BAR_FIND_SYMBOL_RESULTS
                        )
            || !m_wndFindSymbolResultsChild.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |TVS_HASBUTTONS|TVS_INFOTIP
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndFindSymbolResultsBar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndFindSymbolResultsChild
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_FIND_SYMBOL_RESULTS\n");
            return -1;      // fail to create
      }
      m_wndFindSymbolResultsChild.InitFindSymbolResultsTree();
      
      if(   !m_wndFavoritesBar.Create(
                        _T("Favorites"),
                        this,
                        ID_VIEW_BAR_FAVORITES
                        )
            || !m_wndFavoritesChild.Create(
                        CProfStudioFavoritesView::IDD,
                        &m_wndFavoritesBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_FAVORITES\n");
            return -1;      // fail to create
      }
      
      if(   !m_wndDynamicHelpBar.Create(
                        _T("Dynamic Help"),
                        this,
                        ID_VIEW_BAR_DYNAMIC_HELP
                        )
            || !m_wndDynamicHelpChild.Create(
                        &m_wndDynamicHelpBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_DYNAMIC_HELP\n");
            return -1;      // fail to create
      }

      if(   !m_wndHelpContentsBar.Create(
                        _T("Contents"),
                        this,
                        ID_VIEW_BAR_HELP_CONTENTS
                        )
            || !m_wndHelpContentsChild.Create(
                        CProfStudioHelpContentsView::IDD,
                        &m_wndHelpContentsBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_HELP_CONTENTS\n");
            return -1;      // fail to create
      }

      if(   !m_wndHelpIndexBar.Create(
                        _T("Index"),
                        this,
                        ID_VIEW_BAR_HELP_INDEX
                        )
            || !m_wndHelpIndexChild.Create(
                        CProfStudioHelpIndexView::IDD,
                        &m_wndHelpIndexBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_HELP_INDEX\n");
            return -1;      // fail to create
      }

      if(   !m_wndHelpSearchBar.Create(
                        _T("Search"),
                        this,
                        ID_VIEW_BAR_HELP_SEARCH
                        )
            || !m_wndHelpSearchChild.Create(
                        CProfStudioHelpSearchView::IDD,
                        &m_wndHelpSearchBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_HELP_SEARCH\n");
            return -1;      // fail to create
      }

      if(   !m_wndHelpResultsIndexBar.Create(
                        _T("Index Results"),
                        this,
                        ID_VIEW_BAR_HELP_RESULTS_INDEX
                        )
            || !m_wndHelpResultsIndexChild.Create(
                        &m_wndHelpResultsIndexBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_HELP_RESULTS_INDEX\n");
            return -1;      // fail to create
      }
      m_wndHelpResultsIndexChild.InitHelpIndexResults();

      if(   !m_wndHelpResultsSearchBar.Create(
                        _T("Search Results"),
                        this,
                        ID_VIEW_BAR_HELP_RESULTS_SEARCH
                        )
            || !m_wndHelpResultsSearchChild.Create(
                        &m_wndHelpResultsSearchBar
                        )
            )
      {
            TRACE0("Failed to create ID_VIEW_BAR_HELP_RESULTS_SEARCH\n");
            return -1;      // fail to create
      }
      m_wndHelpResultsSearchChild.InitHelpSearchResults();

      if(   !m_wndDebugBreakpointsBar.Create(
                        _T("Breakpoints"),
                        this,
                        ID_DEBUG_WINDOW_BREAKPOINTS
                        )
            || !m_wndDebugBreakpointsChild.Create(
                        CProfStudioBreakpointsView::IDD,
                        &m_wndDebugBreakpointsBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_BREAKPOINTS\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugRunningDocumentsBar.Create(
                        _T("Running Documents"),
                        this,
                        ID_DEBUG_WINDOW_RUNNING_DOCUMENTS
                        )
            || !m_wndDebugRunningDocumentsChild.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |ES_MULTILINE|ES_LEFT|ES_NOHIDESEL|ES_WANTRETURN
                              |ES_AUTOHSCROLL|ES_AUTOVSCROLL
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndDebugRunningDocumentsBar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndDebugRunningDocumentsChild
                              )
                  )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_RUNNING_DOCUMENTS\n");
            return -1;      // fail to create
      }
      m_wndDebugRunningDocumentsChild.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );

      if(   !m_wndDebugWatch1Bar.Create(
                        _T("Watch 1"),
                        this,
                        ID_DEBUG_WINDOW_WATCH_1
                        )
            || !m_wndDebugWatch1Child.Create(
                        &m_wndDebugWatch1Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_WATCH_1\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugWatch2Bar.Create(
                        _T("Watch 2"),
                        this,
                        ID_DEBUG_WINDOW_WATCH_2
                        )
            || !m_wndDebugWatch2Child.Create(
                        &m_wndDebugWatch2Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_WATCH_2\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugWatch3Bar.Create(
                        _T("Watch 3"),
                        this,
                        ID_DEBUG_WINDOW_WATCH_3
                        )
            || !m_wndDebugWatch3Child.Create(
                        &m_wndDebugWatch3Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_WATCH_3\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugWatch4Bar.Create(
                        _T("Watch 4"),
                        this,
                        ID_DEBUG_WINDOW_WATCH_4
                        )
            || !m_wndDebugWatch4Child.Create(
                        &m_wndDebugWatch4Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_WATCH_4\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugAutosBar.Create(
                        _T("Autos"),
                        this,
                        ID_DEBUG_WINDOW_AUTOS
                        )
            || !m_wndDebugAutosChild.Create(
                        &m_wndDebugAutosBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_AUTOS\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugLocalsBar.Create(
                        _T("Locals"),
                        this,
                        ID_DEBUG_WINDOW_LOCALS
                        )
            || !m_wndDebugLocalsChild.Create(
                        &m_wndDebugLocalsBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_LOCALS\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugThisBar.Create(
                        _T("This"),
                        this,
                        ID_DEBUG_WINDOW_THIS
                        )
            || !m_wndDebugThisChild.Create(
                        &m_wndDebugThisBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_THIS\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugCallStackBar.Create(
                        _T("Call Stack"),
                        this,
                        ID_DEBUG_WINDOW_CALL_STACK
                        )
            || !m_wndDebugCallStackChild.Create(
                        &m_wndDebugCallStackBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_CALL_STACK\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugThreadsBar.Create(
                        _T("Threads"),
                        this,
                        ID_DEBUG_WINDOW_THREADS
                        )
            || !m_wndDebugThreadsChild.Create(
                        &m_wndDebugThreadsBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_THREADS\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugModulesBar.Create(
                        _T("Modules"),
                        this,
                        ID_DEBUG_WINDOW_MODULES
                        )
            || !m_wndDebugModulesChild.Create(
                        &m_wndDebugModulesBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_MODULES\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugMemory1Bar.Create(
                        _T("Memory 1"),
                        this,
                        ID_DEBUG_WINDOW_MEMORY_1
                        )
            || !m_wndDebugMemory1Child.Create(
                        CProfStudioMemoryView::IDD,
                        &m_wndDebugMemory1Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_MEMORY_1\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugMemory2Bar.Create(
                        _T("Memory 2"),
                        this,
                        ID_DEBUG_WINDOW_MEMORY_2
                        )
            || !m_wndDebugMemory2Child.Create(
                        CProfStudioMemoryView::IDD,
                        &m_wndDebugMemory2Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_MEMORY_2\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugMemory3Bar.Create(
                        _T("Memory 3"),
                        this,
                        ID_DEBUG_WINDOW_MEMORY_3
                        )
            || !m_wndDebugMemory3Child.Create(
                        CProfStudioMemoryView::IDD,
                        &m_wndDebugMemory3Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_MEMORY_3\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugMemory4Bar.Create(
                        _T("Memory 4"),
                        this,
                        ID_DEBUG_WINDOW_MEMORY_4
                        )
            || !m_wndDebugMemory4Child.Create(
                        CProfStudioMemoryView::IDD,
                        &m_wndDebugMemory4Bar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_MEMORY_4\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugDisassemblyBar.Create(
                        _T("Disassembly"),
                        this,
                        ID_DEBUG_WINDOW_DISASSEMBLY
                        )
            || !m_wndDebugDisassemblyChild.Create(
                        CProfStudioDisassemblyView::IDD,
                        &m_wndDebugDisassemblyBar
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_DISASSEMBLY\n");
            return -1;      // fail to create
      }

      if(   !m_wndDebugRegistersBar.Create(
                        _T("Registers"),
                        this,
                        ID_DEBUG_WINDOW_REGISTERS
                        )
            || !m_wndDebugRegistersChild.Create(
                        WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL
                              |ES_MULTILINE|ES_LEFT|ES_NOHIDESEL|ES_WANTRETURN
                              |ES_AUTOHSCROLL|ES_AUTOVSCROLL
                        ,
                        CRect( 0,0,0,0 ),
                        &m_wndDebugRegistersBar,
                        UINT(IDC_STATIC)
                        )
            || !( (new CProfStudioThinFrame)->
                        CreateDynamicThinFrame(
                              &m_wndDebugRegistersChild
                              )
                        )
            )
      {
            TRACE0("Failed to create ID_DEBUG_WINDOW_REGISTERS\n");
            return -1;      // fail to create
      }
      m_wndDebugRegistersChild.SetFont(
            CFont::FromHandle(
                  (HFONT)::GetStockObject(DEFAULT_GUI_FONT)
                  )
            );
      m_wndDebugRegistersChild.SetWindowText(
            _T("    EAX = 00400000 EBX = 7FFDF000 ECX = 00000001 EDX = 00132C1F\r\n")
            _T("    ESI = 00000000 EDI = 00000000 EIP = 0041D330 ESP = 0012FF14\r\n")
            _T("    EBP = 0012FFC0 EFL = 00000246\r\n")
            _T("\r\n")
            _T("\r\n")
            );
      m_wndDebugRegistersChild.SetSel( -1, -1 );

      if (!m_wndStatusBar.Create(this) ||
            !m_wndStatusBar.SetIndicators(indicators,
              sizeof(indicators)/sizeof(UINT)))
      {
            TRACE0("Failed to create status bar\n");
            return -1;      // fail to create
      }
      m_wndStatusBar.m_bOuterRectInFirstBand = true;

      _splash.SetStatusText(
            _T("Configuring bars ...")
            );

    m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarStandard.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarUiLook.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarDebug.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarBuild.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarTextEditor.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarSourceControl.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarDataDesign.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarDebugLocation.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarXmlData.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarXmlSchema.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarQuery.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolBarWeb.EnableDocking(CBRS_ALIGN_ANY);
      m_wndSolutionExplorerBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndResourceViewBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndClassViewBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndServerExplorerBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndPropertiesBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndToolboxBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndPendingCheckingsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndWebBrowserBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndObjectBrowserBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDocumentOutlineBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndTaskListBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndCommandWindowBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndOutputBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndFindResults1Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndFindResults2Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndFindSymbolResultsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndFavoritesBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndMacroExplorerBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDynamicHelpBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndHelpContentsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndHelpIndexBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndHelpSearchBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndHelpResultsIndexBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndHelpResultsSearchBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugBreakpointsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugRunningDocumentsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugWatch1Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugWatch2Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugWatch3Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugWatch4Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugAutosBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugLocalsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugThisBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugCallStackBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugThreadsBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugModulesBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugMemory1Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugMemory2Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugMemory3Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugMemory4Bar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugDisassemblyBar.EnableDocking(CBRS_ALIGN_ANY);
      m_wndDebugRegistersBar.EnableDocking(CBRS_ALIGN_ANY);
      
      if( !CExtControlBar::FrameEnableDocking(this) )
      {
            ASSERT( FALSE );
            return -1;
      }
      if( !CExtControlBar::FrameInjectAutoHideAreas(this) )
      {
            ASSERT( FALSE );
            return -1;
      }

      _splash.SetStatusText(
            _T("Loading last state ...")
            );

      if(   !CExtControlBar::ProfileBarStateLoad(
                  this,
                  pApp->m_pszRegistryKey,
                  pApp->m_pszProfileName,
                  pApp->m_pszProfileName,
                  &m_dataFrameWP
                  )
            )
      { // if state not loaded - dock initial layout

            _splash.SetStatusText(
                  _T("Docking toolbars ...")
                  );
            
            DockControlBar(&m_wndMenuBar);
            DockControlBar(&m_wndToolBarStandard);
            DockControlBar(&m_wndToolBarWeb);
            DockControlBar(&m_wndToolBarDebug);

            RecalcLayout();
            CRect wrAlreadyDockedBar;
            m_wndToolBarDebug.GetWindowRect( &wrAlreadyDockedBar );
            wrAlreadyDockedBar.OffsetRect( 1, 0 );
            DockControlBar(&m_wndToolBarBuild,AFX_IDW_DOCKBAR_TOP,&wrAlreadyDockedBar);

            RecalcLayout();
            m_wndToolBarBuild.GetWindowRect( &wrAlreadyDockedBar );
            wrAlreadyDockedBar.OffsetRect( 1, 0 );
            DockControlBar(&m_wndToolBarTextEditor,AFX_IDW_DOCKBAR_TOP,&wrAlreadyDockedBar);

            DockControlBar(&m_wndToolBarDataDesign,AFX_IDW_DOCKBAR_LEFT);

            RecalcLayout();
            m_wndToolBarDataDesign.GetWindowRect( &wrAlreadyDockedBar );
            wrAlreadyDockedBar.OffsetRect( 0, 1 );
            DockControlBar(&m_wndToolBarXmlData,AFX_IDW_DOCKBAR_LEFT,&wrAlreadyDockedBar);
            
            RecalcLayout();
            m_wndToolBarXmlData.GetWindowRect( &wrAlreadyDockedBar );
            wrAlreadyDockedBar.OffsetRect( 0, 1 );
            DockControlBar(&m_wndToolBarXmlSchema,AFX_IDW_DOCKBAR_LEFT,&wrAlreadyDockedBar);

            DockControlBar(&m_wndToolBarUiLook,AFX_IDW_DOCKBAR_RIGHT);
            
            DockControlBar(&m_wndToolBarDebugLocation,AFX_IDW_DOCKBAR_BOTTOM);
            DockControlBar(&m_wndToolBarSourceControl,AFX_IDW_DOCKBAR_BOTTOM);
            
            RecalcLayout();
            m_wndToolBarSourceControl.GetWindowRect( &wrAlreadyDockedBar );
            wrAlreadyDockedBar.OffsetRect( 1, 0 );
            DockControlBar(&m_wndToolBarQuery,AFX_IDW_DOCKBAR_BOTTOM,&wrAlreadyDockedBar);

            RecalcLayout();

            _splash.SetStatusText(
                  _T("Docking panels: project management ...")
                  );

            m_wndResourceViewBar.SetInitDesiredSizeVertical( CSize(200,30) );
            m_wndResourceViewBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_LEFT, true );
            m_wndResourceViewBar.DockControlBarIntoTabbedContainer(
                  &m_wndSolutionExplorerBar, -1, NULL, false );
            m_wndResourceViewBar.DockControlBarIntoTabbedContainer(
                  &m_wndClassViewBar, 0, NULL, false );
            
            RecalcLayout();

            m_wndServerExplorerBar.SetInitDesiredSizeVertical( CSize(200,30) );
            m_wndServerExplorerBar.DockControlBarLTRB(
                  &m_wndResourceViewBar, AFX_IDW_DOCKBAR_BOTTOM );
            m_wndServerExplorerBar.DockControlBarIntoTabbedContainer(
                  &m_wndMacroExplorerBar, -1, NULL, false );

            _splash.SetStatusText(
                  _T("Docking panels: help system ...")
                  );

            m_wndHelpIndexBar.SetInitDesiredSizeVertical( CSize(200,30) );
            m_wndHelpIndexBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_RIGHT, true );
            m_wndHelpIndexBar.DockControlBarIntoTabbedContainer(
                  &m_wndHelpSearchBar, -1, NULL, false );
            m_wndHelpIndexBar.DockControlBarIntoTabbedContainer(
                  &m_wndHelpResultsIndexBar, -1, NULL, false );
            m_wndHelpIndexBar.DockControlBarIntoTabbedContainer(
                  &m_wndHelpResultsSearchBar, -1, NULL, false );
            m_wndHelpIndexBar.DockControlBarIntoTabbedContainer(
                  &m_wndHelpContentsBar, 0, NULL, false );

            _splash.SetStatusText(
                  _T("Docking panels: outputs and source control ...")
                  );

            m_wndOutputBar.SetInitDesiredSizeHorizontal( CSize(400,200) );
            m_wndOutputBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_BOTTOM, true );
            m_wndOutputBar.DockControlBarIntoTabbedContainer(
                  &m_wndTaskListBar, -1, NULL, false );
            m_wndOutputBar.DockControlBarIntoTabbedContainer(
                  &m_wndPropertiesBar, -1, NULL, false );
            m_wndOutputBar.DockControlBarIntoTabbedContainer(
                  &m_wndCommandWindowBar, -1, NULL, false );

            RecalcLayout();
            
            m_wndObjectBrowserBar.DockControlBarLTRB(
                  &m_wndOutputBar, AFX_IDW_DOCKBAR_RIGHT );
            m_wndObjectBrowserBar.DockControlBarIntoTabbedContainer(
                  &m_wndPendingCheckingsBar, -1, NULL, false );

            RecalcLayout();

            m_wndFindResults2Bar.DockControlBarLTRB(
                  &m_wndHelpIndexBar, AFX_IDW_DOCKBAR_BOTTOM );
            m_wndFindResults2Bar.DockControlBarIntoTabbedContainer(
                  &m_wndFindSymbolResultsBar, -1, NULL, false );
            m_wndFindResults2Bar.DockControlBarIntoTabbedContainer(
                  &m_wndFindResults1Bar, 0, NULL, false );

            _splash.SetStatusText(
                  _T("Docking panels: document tools and browsers ...")
                  );

            m_wndToolboxBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_RIGHT, true );
            m_wndToolboxBar.DockControlBarIntoTabbedContainer(
                  &m_wndDocumentOutlineBar, -1, NULL, false );

            m_wndWebBrowserBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_BOTTOM, true );
            m_wndWebBrowserBar.DockControlBarIntoTabbedContainer(
                  &m_wndFavoritesBar, -1, NULL, false );
            m_wndWebBrowserBar.DockControlBarIntoTabbedContainer(
                  &m_wndDynamicHelpBar, 0, NULL, false );

            _splash.SetStatusText(
                  _T("Docking panels: breakpoints and debug info ...")
                  );

            m_wndDebugBreakpointsBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_LEFT, true );
            m_wndDebugBreakpointsBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugRunningDocumentsBar, -1, NULL, false );

            m_wndDebugAutosBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_TOP, true );
            m_wndDebugAutosBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugLocalsBar, -1, NULL, false );
            m_wndDebugAutosBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugThisBar, -1, NULL, false );
            m_wndDebugAutosBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugWatch1Bar, -1, NULL, false );
            m_wndDebugAutosBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugWatch2Bar, -1, NULL, false );
            m_wndDebugAutosBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugWatch3Bar, -1, NULL, false );
            m_wndDebugAutosBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugWatch4Bar, -1, NULL, false );

            m_wndDebugCallStackBar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_TOP, true );
            m_wndDebugCallStackBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugThreadsBar, -1, NULL, false );
            m_wndDebugCallStackBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugModulesBar, -1, NULL, false );

            RecalcLayout();

            _splash.SetStatusText(
                  _T("Docking panels: memory and disassembly ...")
                  );
            
            m_wndDebugDisassemblyBar.DockControlBarLTRB(
                  &m_wndDebugCallStackBar, AFX_IDW_DOCKBAR_RIGHT );
            m_wndDebugDisassemblyBar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugRegistersBar, -1, NULL, false );

            m_wndDebugMemory1Bar.DockControlBarInnerOuter(
                  AFX_IDW_DOCKBAR_BOTTOM, true );
            m_wndDebugMemory1Bar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugMemory2Bar, -1, NULL, false );
            m_wndDebugMemory1Bar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugMemory3Bar, -1, NULL, false );
            m_wndDebugMemory1Bar.DockControlBarIntoTabbedContainer(
                  &m_wndDebugMemory4Bar, -1, NULL, false );

            _splash.SetStatusText(
                  _T("Updating state ...")
                  );

            RecalcLayout();
            
            //m_wndClassViewBar.AutoHideModeSet( true, false, false, true );
            //m_wndHelpContentsBar.AutoHideModeSet( true, false, false, true );
            //m_wndOutputBar.AutoHideModeSet( true, false, false, true );
            //m_wndServerExplorerBar.AutoHideModeSet( true, false, false, true );
            //m_wndFindResults1Bar.AutoHideModeSet( true, false, false, true );
            m_wndWebBrowserBar.AutoHideModeSet( true, false, false, true );
            m_wndToolboxBar.AutoHideModeSet( true, false, false, true );
            m_wndDebugBreakpointsBar.AutoHideModeSet( true, false, false, true );
            m_wndDebugAutosBar.AutoHideModeSet( true, false, false, true );
            m_wndDebugCallStackBar.AutoHideModeSet( true, false, false, true );
            m_wndDebugDisassemblyBar.AutoHideModeSet( true, false, false, true );
            m_wndDebugMemory1Bar.AutoHideModeSet( true, false, false, true );
            m_wndObjectBrowserBar.AutoHideModeSet( true, false, false, true );

            //ShowControlBar( &m_wndMenuBar, FALSE, TRUE );
            //ShowControlBar( &m_wndToolBarStandard, FALSE, TRUE );
            //ShowControlBar( &m_wndToolBarUiLook, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarDebug, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarBuild, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarTextEditor, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarSourceControl, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarDataDesign, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarDebugLocation, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarXmlData, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarXmlSchema, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarQuery, FALSE, TRUE );
//          ShowControlBar( &m_wndToolBarWeb, FALSE, TRUE );

      } // if state not loaded - dock initial layout

#if (!defined __EXT_MFC_NO_TABMDI_CTRL )
      if( ! m_wndMdiTabs.Create(
                  this,
                  CRect(0,0,0,0),
                  UINT(IDC_STATIC),
                  WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS,
                  __ETWS_MDI_DEFAULT|__ETWS_HIDE_ICONS
                  )
            )
      {
            TRACE0("Failed to create m_wndMdiTabs\n");
            return -1;      // fail to create
      }
      m_wndMdiTabs.ModifyTabWndStyle( 0, __ETWS_SHOW_BTN_TAB_LIST|__ETWS_ENABLED_BTN_TAB_LIST );
#endif // (!defined __EXT_MFC_NO_TABMDI_CTRL )

      _splash.DestroyWindow();

      PostMessage( WM_COMMAND, ID_FILE_NEW );

      return 0;
}