CMFCOutlookBarTabCtrl save state problem
-
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.
-
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.
What changes are meant exactly, please ? :)
Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition
-
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.
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
-
What changes are meant exactly, please ? :)
Check your definition of Irrationality[^] :) 1 - Avicenna 5 - Hubbard 3 - Own definition
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(
-
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
-
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(
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
-
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
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.
-
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.
-
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.
-
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?
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.
-
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.
Yes, you could use your
CWnAppEx::SaveState(..)
andCWinAppEx::LoadState(...)
:)virtual void BeHappy() = 0;