Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CMFCOutlookBarTabCtrl save state problem

CMFCOutlookBarTabCtrl save state problem

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studioarchitecturehelp
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A Ms
    wrote on last edited by
    #1

    I have Developed an application using VC++ 10 (VS 2010 RC) to create a document/view architecture with Ribbon Menus and a Outlook Bar pane with (CMFCOutlookBarTabCtrl) The First time I have created the bar it appears like what my codes were implemented it but after I have customize The bar in running Mode. I can't see changes I have made in code after rebuilding the application. It seems that It save the previous state of outlook bar. what should I do to so that I could see it in the way my code implements.

    E L 2 Replies Last reply
    0
    • A A Ms

      I have Developed an application using VC++ 10 (VS 2010 RC) to create a document/view architecture with Ribbon Menus and a Outlook Bar pane with (CMFCOutlookBarTabCtrl) The First time I have created the bar it appears like what my codes were implemented it but after I have customize The bar in running Mode. I can't see changes I have made in code after rebuilding the application. It seems that It save the previous state of outlook bar. what should I do to so that I could see it in the way my code implements.

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      What changes are meant exactly, please ? :)

      Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition

      A 1 Reply Last reply
      0
      • A A Ms

        I have Developed an application using VC++ 10 (VS 2010 RC) to create a document/view architecture with Ribbon Menus and a Outlook Bar pane with (CMFCOutlookBarTabCtrl) The First time I have created the bar it appears like what my codes were implemented it but after I have customize The bar in running Mode. I can't see changes I have made in code after rebuilding the application. It seems that It save the previous state of outlook bar. what should I do to so that I could see it in the way my code implements.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Any dynamic changes you make while your app is running are not saved into your source code. If you want changes to be permanent then you need to make them in your source code, before you rebuild.

        txtspeak is the realm of 9 year old children, not developers. Christian Graus

        A 1 Reply Last reply
        0
        • E Eugen Podsypalnikov

          What changes are meant exactly, please ? :)

          Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition

          A Offline
          A Offline
          A Ms
          wrote on last edited by
          #4

          This is my code for CMFCOutlookBarTabCtrl:

          BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, int nInitialWidth/* = 250*/)
          {

          //Outlookbar Style
          bar.SetMode2003(FALSE);
          
          
          BOOL bNameValid;
          CString strTemp;
          bNameValid = strTemp.LoadString(IDS\_SHORTCUTS);
          ASSERT(bNameValid);
          
          
          //Creating OutlookBar
          if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS\_CHILD | WS\_VISIBLE | CBRS\_LEFT))
          {
          	return FALSE; // fail to create
          }
          
          
          //retrieving OutlookBarTabCtrl pointer
          CMFCOutlookBarTabCtrl\* pOutlookBar = (CMFCOutlookBarTabCtrl\*)bar.GetUnderlyingWindow();
          
          if (pOutlookBar == NULL)
          {
          	ASSERT(FALSE);
          	return FALSE;
          }
          
          
          
          pOutlookBar->EnableInPlaceEdit(TRUE);
          
          
          //Creating Tab Panes
          
          DWORD dwPaneStyle = AFX\_DEFAULT\_TOOLBAR\_STYLE | CBRS\_FLOAT\_MULTI;
          
          // can float, can autohide, can resize, CAN NOT CLOSE
          DWORD dwStyle = AFX\_CBRS\_FLOAT | AFX\_CBRS\_AUTOHIDE | AFX\_CBRS\_RESIZE;
          
          
          static UINT uiPageID = 10;
          
          
          \_m\_OutlookPane1.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
          \_m\_OutlookPane1.SetOwner(this);
          \_m\_OutlookPane1.EnableTextLabels();
          \_m\_OutlookPane1.EnableDocking(CBRS\_ALIGN\_ANY);
          //\_m\_OutlookPane1.SetDefaultState();
          pOutlookBar->AddControl(&\_m\_OutlookPane1, \_T("Scene\*"), 0, TRUE, dwStyle);
          
          
          \_m\_OutlookPane2.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
          \_m\_OutlookPane2.SetOwner(this);
          \_m\_OutlookPane2.EnableTextLabels();
          \_m\_OutlookPane2.EnableDocking(CBRS\_ALIGN\_ANY);
          //\_m\_OutlookPane2.SetDefaultState();
          pOutlookBar->AddControl(&\_m\_OutlookPane2, \_T("Walls\*"), 1, TRUE, dwStyle);
          
          
          \_m\_OutlookPane3.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
          \_m\_OutlookPane3.SetOwner(this);
          \_m\_OutlookPane3.EnableTextLabels();
          \_m\_OutlookPane3.EnableDocking(CBRS\_ALIGN\_ANY);
          //\_m\_OutlookPane3.SetDefaultState();
          pOutlookBar->AddControl(&\_m\_OutlookPane3, \_T("Furnitures\*"), 2, TRUE, dwStyle);
          
          
          \_m\_OutlookPane4.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
          \_m\_OutlookPane4.SetOwner(this);
          \_m\_OutlookPane4.EnableTextLabels();
          \_m\_OutlookPane4.EnableDocking(CBRS\_ALIGN\_ANY);
          //\_m\_OutlookPane4.SetDefaultState();
          pOutlookBar->AddControl(&\_m\_OutlookPane4, \_T("Decorations\*"), 3, TRUE, dwStyle);
          
          
          \_m\_OutlookPane5.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
          \_m\_OutlookPane5.SetOwner(this);
          \_m\_OutlookPane5.EnableTextLabels();
          \_m\_OutlookPane5.EnableDocking(CBRS\_ALIGN\_ANY);
          //\_m\_OutlookPane5.SetDefaultState();
          pOutlookBar->AddControl(
          
          E 1 Reply Last reply
          0
          • L Lost User

            Any dynamic changes you make while your app is running are not saved into your source code. If you want changes to be permanent then you need to make them in your source code, before you rebuild.

            txtspeak is the realm of 9 year old children, not developers. Christian Graus

            A Offline
            A Offline
            A Ms
            wrote on last edited by
            #5

            I think i couldn't discuss the problem clearly, I mean I have changed the application in running mode, know the application rebuilds every time in the way I have changed it in running mode and every change I have made in source code became defectiveness.

            1 Reply Last reply
            0
            • A A Ms

              This is my code for CMFCOutlookBarTabCtrl:

              BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, int nInitialWidth/* = 250*/)
              {

              //Outlookbar Style
              bar.SetMode2003(FALSE);
              
              
              BOOL bNameValid;
              CString strTemp;
              bNameValid = strTemp.LoadString(IDS\_SHORTCUTS);
              ASSERT(bNameValid);
              
              
              //Creating OutlookBar
              if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS\_CHILD | WS\_VISIBLE | CBRS\_LEFT))
              {
              	return FALSE; // fail to create
              }
              
              
              //retrieving OutlookBarTabCtrl pointer
              CMFCOutlookBarTabCtrl\* pOutlookBar = (CMFCOutlookBarTabCtrl\*)bar.GetUnderlyingWindow();
              
              if (pOutlookBar == NULL)
              {
              	ASSERT(FALSE);
              	return FALSE;
              }
              
              
              
              pOutlookBar->EnableInPlaceEdit(TRUE);
              
              
              //Creating Tab Panes
              
              DWORD dwPaneStyle = AFX\_DEFAULT\_TOOLBAR\_STYLE | CBRS\_FLOAT\_MULTI;
              
              // can float, can autohide, can resize, CAN NOT CLOSE
              DWORD dwStyle = AFX\_CBRS\_FLOAT | AFX\_CBRS\_AUTOHIDE | AFX\_CBRS\_RESIZE;
              
              
              static UINT uiPageID = 10;
              
              
              \_m\_OutlookPane1.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
              \_m\_OutlookPane1.SetOwner(this);
              \_m\_OutlookPane1.EnableTextLabels();
              \_m\_OutlookPane1.EnableDocking(CBRS\_ALIGN\_ANY);
              //\_m\_OutlookPane1.SetDefaultState();
              pOutlookBar->AddControl(&\_m\_OutlookPane1, \_T("Scene\*"), 0, TRUE, dwStyle);
              
              
              \_m\_OutlookPane2.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
              \_m\_OutlookPane2.SetOwner(this);
              \_m\_OutlookPane2.EnableTextLabels();
              \_m\_OutlookPane2.EnableDocking(CBRS\_ALIGN\_ANY);
              //\_m\_OutlookPane2.SetDefaultState();
              pOutlookBar->AddControl(&\_m\_OutlookPane2, \_T("Walls\*"), 1, TRUE, dwStyle);
              
              
              \_m\_OutlookPane3.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
              \_m\_OutlookPane3.SetOwner(this);
              \_m\_OutlookPane3.EnableTextLabels();
              \_m\_OutlookPane3.EnableDocking(CBRS\_ALIGN\_ANY);
              //\_m\_OutlookPane3.SetDefaultState();
              pOutlookBar->AddControl(&\_m\_OutlookPane3, \_T("Furnitures\*"), 2, TRUE, dwStyle);
              
              
              \_m\_OutlookPane4.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
              \_m\_OutlookPane4.SetOwner(this);
              \_m\_OutlookPane4.EnableTextLabels();
              \_m\_OutlookPane4.EnableDocking(CBRS\_ALIGN\_ANY);
              //\_m\_OutlookPane4.SetDefaultState();
              pOutlookBar->AddControl(&\_m\_OutlookPane4, \_T("Decorations\*"), 3, TRUE, dwStyle);
              
              
              \_m\_OutlookPane5.Create(&bar, dwPaneStyle, uiPageID++, dwStyle);
              \_m\_OutlookPane5.SetOwner(this);
              \_m\_OutlookPane5.EnableTextLabels();
              \_m\_OutlookPane5.EnableDocking(CBRS\_ALIGN\_ANY);
              //\_m\_OutlookPane5.SetDefaultState();
              pOutlookBar->AddControl(
              
              E Offline
              E Offline
              Eugen Podsypalnikov
              wrote on last edited by
              #6

              OK :) After the creating of CMainFrameWnd (with all inside) - you could call SaveState(<DefaultProfile>) explicitly... Then will be called LoadState(<LastProfile>), that has been saved at the last exiting... Your toolbar could provide a command for LoadState(<DefaultProfile>) to load the init state after the creating :) 2. You can prevent a part of or the whole loading 3. The saved data could be found (and deleted) in registries

              Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition

              modified on Tuesday, March 9, 2010 11:17 AM

              A 1 Reply Last reply
              0
              • E Eugen Podsypalnikov

                OK :) After the creating of CMainFrameWnd (with all inside) - you could call SaveState(<DefaultProfile>) explicitly... Then will be called LoadState(<LastProfile>), that has been saved at the last exiting... Your toolbar could provide a command for LoadState(<DefaultProfile>) to load the init state after the creating :) 2. You can prevent a part of or the whole loading 3. The saved data could be found (and deleted) in registries

                Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition

                modified on Tuesday, March 9, 2010 11:17 AM

                A Offline
                A Offline
                A Ms
                wrote on last edited by
                #7

                Thank you for spending time to solve my problem. I could not found the CMainFrameWnd::SaveState method, But the CMainFrameWnd could implement the CMainFrameWnd::SaveBarState(..) method Which takes CWinApp::m_pszProfileName as it's Argument. But even using this method didn't solve my problem even I have searched the whole registery and Profile for value of m_pszProfileName But I did not found any result, I know It 's saved somewhere because when I compiled It in an other profile the frame look the same as it's source implement it. This problem really Bother me.

                A E 2 Replies Last reply
                0
                • A A Ms

                  Thank you for spending time to solve my problem. I could not found the CMainFrameWnd::SaveState method, But the CMainFrameWnd could implement the CMainFrameWnd::SaveBarState(..) method Which takes CWinApp::m_pszProfileName as it's Argument. But even using this method didn't solve my problem even I have searched the whole registery and Profile for value of m_pszProfileName But I did not found any result, I know It 's saved somewhere because when I compiled It in an other profile the frame look the same as it's source implement it. This problem really Bother me.

                  A Offline
                  A Offline
                  A Ms
                  wrote on last edited by
                  #8

                  Thanks I found the answer the whole setting is stored in HKEY_CURRENT_USER\Software\Local AppWizard-Generated Applications\%ApplicationName% and I should delete this registry.

                  L 1 Reply Last reply
                  0
                  • A A Ms

                    Thanks I found the answer the whole setting is stored in HKEY_CURRENT_USER\Software\Local AppWizard-Generated Applications\%ApplicationName% and I should delete this registry.

                    L Offline
                    L Offline
                    laoyun
                    wrote on last edited by
                    #9

                    I am having the same problem and have to delete the registry entry. I wonder which part writes it to the registry, Visual Studio or my Application? And how do I disable writing to the registry either in the Visual Studio or in Application?

                    A 1 Reply Last reply
                    0
                    • L laoyun

                      I am having the same problem and have to delete the registry entry. I wonder which part writes it to the registry, Visual Studio or my Application? And how do I disable writing to the registry either in the Visual Studio or in Application?

                      A Offline
                      A Offline
                      A Ms
                      wrote on last edited by
                      #10

                      Of course the Application is responsible for saving registry info, you could test it with running release build explicitly from Bin file and changing the application custom setting, and the registry key Name is stored in your main application class cpp file (class drived form CWinAppEx) in the CwinAppEx::::InitInstance() method in the

                      SetRegistryKey(_T("Local AppWizard-Generated Applications"));

                      but I have no idea of where it save the custom styles. It should be some where after whole main frame is created.

                      1 Reply Last reply
                      0
                      • A A Ms

                        Thank you for spending time to solve my problem. I could not found the CMainFrameWnd::SaveState method, But the CMainFrameWnd could implement the CMainFrameWnd::SaveBarState(..) method Which takes CWinApp::m_pszProfileName as it's Argument. But even using this method didn't solve my problem even I have searched the whole registery and Profile for value of m_pszProfileName But I did not found any result, I know It 's saved somewhere because when I compiled It in an other profile the frame look the same as it's source implement it. This problem really Bother me.

                        E Offline
                        E Offline
                        Eugen Podsypalnikov
                        wrote on last edited by
                        #11

                        Yes, you could use your CWnAppEx::SaveState(..) and CWinAppEx::LoadState(...) :)

                        virtual void BeHappy() = 0;

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups