Customized Toolbar RestoreState() fails if it has only 1 button

This issue happens only when the numbers of buttons in the tool bar is
"1". Thats is, the user launches the customize toolbar dialog and
removes all but 1 tool bar button.

I have multiple Tool bars which I persist on application close and
restore on application load. The SaveState() works fine as I notice
the value "55 81 00 00" saved if only 1 button is left in the Tool
bar.

Here is the code for the RestoreState
	for (int i = 0; i < m_ToolBars.GetSize(); i++) {
		HKEY hSecKey = AfxGetApp()->GetSectionKey("Tool Bars");
		if (hSecKey == NULL)
			break;
		CString sTitle;
		m_ToolBars[i]->GetWindowText(sTitle);
		m_ToolBars[i]->GetToolBarCtrl().RestoreState(hSecKey, "", sTitle);
            }

If more than one button is present, the Toolbar events get triggered
correctly (for example, TBN_ENDADJUST). And RestoreState() retrieves
the data correctly.

Could anyone please shed some light on this, I have spent a lot of
time debugging this issue.

Thanks in advance.
0
3/26/2008 10:48:28 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
510 Views

Similar Articles

[PageSpeed] 44

Reply:

Similar Artilces:

Office 2003 Toolbars
I was having a problem in Office XP with links to other spreadsheets. Every time I clicked a link and opened another spreadsheet, the Web and Review toolbars would open. I inserted the follwoing code in each Workbook and it solved the problem: Sub Workbook_Open() ' Hide the "Web" and "Reviewing" Toolbars/Commandbars Application.CommandBars("Web").Visible = False Application.CommandBars("Reviewing").Visible = False End Sub I have now upgraded to Office 2003 and the Web toolbar still opens, even though the code is there. Any ide...

Need to re-add "Tools" button to Menu Bar
I have inadvertantly removed the "Tools" button from my Menu Bar an need to re-add it. Does anyone know how to do that? Thank -- Message posted from http://www.ExcelForum.com Hi goto 'Tools - customize', select your menubar in this list and click 're-set' -- Regards Frank Kabel Frankfurt, Germany > I have inadvertantly removed the "Tools" button from my Menu Bar and > need to re-add it. Does anyone know how to do that? > Thanks > > > --- > Message posted from http://www.ExcelForum.com/ A) The OP lost his Tools menu, so he can&#...

Where does my Custom Invoice live?
I created a custom invoice in MS Money Small Biz. Later, I installed a new hard drive and re-installed money and brought in my original Money file. When I went to print invoices I discovered that my customized invoices did not come across with my Money file. I still have a backup of all the old money program files on my old hard drive, but I don't know in which one my custom invoice lives. Any ideas? PS - Yes, I know... if I'd been smart I would have exported the custom invoice first before swapping hard drives. ;-) ...

Pop Form Based On individual Customer
How would you assign a pop up message for an individual customer for example let say i go to the record john doe I want to assign a pop up message for that specific customer so who ever enters into that record the message will pop up automatically with notes or the user cld add notes. I have the following Customer Table Pop Up Message Table CustomerID(PK) MessageID(PK) LastName CustomerID(Lookup Customer Table) FirstName Note SS# Address1 Address2 City State Zip Phone ...

GP 10 Toolbar
The toolbars in GP 10 (10.00.1237) randomly re-set. If a user sets the toolbar to one line, and then at the end of the day logs out, when they log back in, the toolbar has re-set itself to a 3 or 4 line toolbar. The "lock toolbar" function is checked. Why would these settings keep changing? This is very frustrating for users. Any advice ? THANKS! Laura This has been a known bug for a while. I have not heard of it being resolved yet, but you can open a support case with MS and get added to the list of people who have reported the problem. Best regards, -- MG.- Mariano...

Support for custom look up fields
I am dissappointed to learn the MS CRM 3.0 do not support custom made look up fields at a more profound level. I do acknowledge the work done on solving some of the issues concerning relationships between accounts and contact etc. through the relationship entity , but this solution still seems much more complex to manage in comparison to the possibility of simply creating and adding custom look up fields to your forms and thereby managing relationships - just the same way as pointing out a "primary contact" person. ---------------- This post is a suggestion for Microsoft, and ...

excel toolbars #3
make different toolbars for each excel file. You've got one response to your first post. C. Christman wrote: > > make different toolbars for each excel file. -- Dave Peterson ...

"Out of Office" Missing from toolbar in Outlook 2007
Just noticed this today. Looking for guidance. Are you using an Exchange account? Also see; http://www.msoutlook.info/question/374 -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "Maurice" <Maurice@discussions.microsoft.com> wrote in message news:C16106D3-342C-42F1-B440-FC8842EC4BB5@microsoft.com... > Just noticed this today. Looking for guidance. Just to clarify,...

Problem saving embedded .gif or .jpg (.bmp only option)
(Sorry for crosspost - also posted in "microsoft.public.outlook.general") I've seen this question posted a half dozen times, and I've yet to see a solution. Problem: When an animated .gif (ditto for .jpg) is embedded in the body of a message (Outlook 2002 (Windows XP (home) with Office XP 2002) - I'm NOT using Outlook Express), the ONLY option I have for saving the embedded .gif (or .jpg) is in .bmp format - no other option is available. (See attached screen print for clarification.) I have deleted all Temp Internet Folders & files; I have cleared Internet History...

Search the web button
When I click on the "search the web" button it sends me to msn.com to do my search. How can I change this to a different address? ...

Customer EFT Bank Country/Region
In Dynamics 10, I'm looking at the Customer EFT Bank Maintenance screen. Here's how you get to it: Click Cards, Sales, Customer. This brings up the Customer Maintenance screen. Choose a customer, then press the Accounts button. This brings up the Customer Address Maintenance screen. Click the EFT Bank button. This brings up the Customer EFT Bank Maintenance screen. On that screen, there is a field called Bank Country/Region. Click the down arrow to see a list of countries/regions. My question is: Where does that list come from? Is it stored in a table? ...

Customizing Outlook Today #10
When the CEO changes the Outlook Today from standard to standard 2 column and saves the setting. Then he goes into his inbox and then returns to Outlook today, the Outlook Today is in the standard 3 column format not the 2 column format that he just saved earlier. KB was not much help. Any possible solutions to his problem in keeping the 2 column setting? Ruben ...

Saving Toolbar settings
I am running OL2003. When I open my Inbox and arrange my toolbars the way that I like them, I'd like them to stay that way the next time that I open OL. Instead the defaults load and I'm back to the orginal configuration. Any ideas how to "save" the Toolbar settings? Randy Randy, I'm not sure whether this will make a difference or not. But are you doing this with Administrator privialages? Like I said, not sure whether it will make any difference at all but it's something to try. regards, Ash. Thanks for your response. Yes, I am logged on with Adminis...

cannot delete custom page in Business Portal
I created a page and I want it deleted. When I try to remove the page, I get the error - this item is currently being used in a menu or task and cannot be removed. I have not included this page anywhere. How can I figure out what is stopping the page from being deleted? Go to Manage Navigation and delete the menu first then go to Manage Portal Pages then Remove it -- http://ddelprado.blogspot.com "Jack Tundra" wrote: > I created a page and I want it deleted. When I try to remove the page, I get > the error - this item is currently being used in a menu or task and ...

Custom menu: action is not trigger
Hi, For the first time I am developping an Access application with a custom toolbar (menu) at the top. I have found various posting or web sites where people explain how to do the setup. In fact, I have followed the instructions coming from this web site. http://www.jamiessoftware.tk/articles/menubars.html When my application opens, I can see my custom menu at the top of the form. My problem is the following: when I click on an item in the menu, nothing happen !!! I have double-ckeck and I have really associated an action to the menu item. In fact I have tried to associate the menu item to a ...

No attribute when adding parent customer to person
we see this message quite frequently. We add a new business, fill out all the data. Create a new person and when we add the company in the parent company field and save we get a no attribute error. Usually I will delete the person and recreate the person and it works. However this person has opened a new company and we do not want to lose the old links. Hi John, Can you provide the error message to us? or do you have access to the server event viewer? Do you see any errors there? If so can you please post the message here as well so we can help further. Thanks! Darren Liu, Microsof...

Correcting customer address codes or shipping addresses
My client is on Dynamics GP v9 and has been using Dynamics since 2001. It's been 7.5 years since they started using this software program. During this time, they have had several different people create customer cards etc and there are now several duplicate addresses for the same customer (same account ID but just identical addresses with a different address code for that customer). They are wanting to clean up this database. They are preparing to use the modifyer and combiner to combine customers that have two different account numbers but what is the BEST WAY to remove the dup...

CRM 1.2 and Great Plains 8.0 Integration
Hi there, I am Nery and need tood know if there is some way to integrate CRM 1.2 and Great Plains 8.0 Thanks ...

Office X Toolbars keep closing
Is there a way to get the standard and formatting toolbars to stay on the screen. Every once in a while, I accidentally close them by clicking the square in the upper left corner. I would like to get that square off of the toolbar so I can't close them anymore. Please help! thanks, Devin In article <1724b01c41831$f8aae530$a401280a@phx.gbl>, "dholzer@conejo.k12.ca.us" <anonymous@discussions.microsoft.com> wrote: > Is there a way to get the standard and formatting > toolbars to stay on the screen. Every once in a while, I > accidentally close t...

Excel wont let me take an old workbook & save as to make a new 1
For some reason excel will not let me do a save as on an old workbook to make a copy it just stops responding?....Rik Did you just update windows? http://support.microsoft.com/default.aspx/kb/918165 -- Regards, Peo Sjoblom http://nwexcelsolutions.com "Rik" <Rik@discussions.microsoft.com> wrote in message news:3AB69540-0AE5-46ED-8F8E-B8ACDCDF5372@microsoft.com... > For some reason excel will not let me do a save as on an old workbook to > make > a copy it just stops responding?....Rik ...

How do I find the Email "Send" button in Outlook 2007?
I have tried to follow the Outlook 2003 - Outlook 2007 trail instructions and there is no "Send" button. How do I find it? Thanks "Tuner" <Tuner@discussions.microsoft.com> wrote in message news:915D7380-730E-4F7D-B565-8241260A0DAF@microsoft.com... >I have tried to follow the Outlook 2003 - Outlook 2007 trail instructions >and > there is no "Send" button. How do I find it? > > Thanks Have you set up a mail account? And what version do you have? ...

Excel keeps crashing and cannot download update 12.0.1
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Excel keeps crashing and cannot download update 12.0.1 saying cannot find that software on that drive On May 1, 2:14 pm, mic...@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > > Excel keeps crashing and cannot download update 12.0.1 saying cannot find that software on that drive Hi, I just posted this to another message, but in general the same thing may apply so I am posting it here too. BTW you can try just removing all the preferences files first and see if you can update. <Fr...

Exchange Server 2003 Service Pack 1
HI I was trying to deploy SP1 for Exchange 2003 from command line (testing deployment with SMS in mind). I was not able to find any documentation(deployment article) that would mention command line switches for SP1. Any info will be greatly appreciated. Thanks MS ...

Changing Customer address ID
We need to update Customer Addresses ID(Cards >> Sales >>Addresses). We have searched for tool in Professional Tool Library. This option is also not available in CRG Changer. Is there any tool available to change the customer address IDs? We are planning to write scripts to update data in case no tool is available We use address ID in extender and SOP orders. We are all planning to update data in SOP tables (Open, Work, and Historical) and tables storing extender data. Is there any other place we need to update? Jove, I wrote a query a while a back that would allow you to find...

template for labels: 1 X 1 1/2 in. labels, 50/sheet
I can't find template to print labels of this type: 1 X 1 1/2 inches; 50/sheet; 5 across & 10 down; need badly for school project; please help File, Page setup, custom, type 1.5 width, 1 inch height, click change copies per sheet. side margin .5, top margin .5. Zero gaps. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "rspeedrob" <rspeedrob@discussions.microsoft.com> wrote in message news:8888CB3A-4794-4768-A7F9-30B0926CE9F1@microsoft.com... >I can't find template to print labels of this type: 1 X ...