Problem persisting toolbar state

I'm trying to use SaveBarState("BarState") and LoadBarState("BarState")
to remember the state of my toolbars.  This works fine for all my toolbars
except 2.  Checking the registry reveals that the 2 bars are not listed (at 
least there
is no matching BarID entry).  When I show them from my view menu the first 
toolbar
(IDR_MAINFRAME) shows up docked to the right side, not where I left it.  And 
the
second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct row,
i.e. I moved it down to form a second row, but has moved back to its 
original
horizontal position which is right next to the first toolbar's original 
position.
Is there anything that would prevent these toolbars information being 
recorded?

Thanks,
Drew 


0
4/1/2005 11:07:09 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
453 Views

Similar Articles

[PageSpeed] 32

"Drew Myers" <drew.nospam.myers@esrd.com> wrote in message 
news:%23iE%23I%23wNFHA.244@TK2MSFTNGP12.phx.gbl...
> I'm trying to use SaveBarState("BarState") and LoadBarState("BarState")
> to remember the state of my toolbars.  This works fine for all my toolbars
> except 2.  Checking the registry reveals that the 2 bars are not listed 
> (at least there
> is no matching BarID entry).  When I show them from my view menu the first 
> toolbar
> (IDR_MAINFRAME) shows up docked to the right side, not where I left it. 
> And the
> second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct row,
> i.e. I moved it down to form a second row, but has moved back to its 
> original
> horizontal position which is right next to the first toolbar's original 
> position.
> Is there anything that would prevent these toolbars information being 
> recorded?
>
> Thanks,
> Drew


Are you by chance using rebars?  If you are, the SaveBarState/LoadBarState 
functions will not work as expected.  I too ran across this problem and 
could not find a readily available solution so I decided to write my own 
functions in my configuration class.

-- 
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


0
4/1/2005 11:46:49 PM
"Frank Hickman [MVP]" <fhickman_NOSP@M_noblesoft.com> wrote in message 
news:%23I7OnXxNFHA.2704@TK2MSFTNGP15.phx.gbl...
> "Drew Myers" <drew.nospam.myers@esrd.com> wrote in message 
> news:%23iE%23I%23wNFHA.244@TK2MSFTNGP12.phx.gbl...
>> I'm trying to use SaveBarState("BarState") and LoadBarState("BarState")
>> to remember the state of my toolbars.  This works fine for all my 
>> toolbars
>> except 2.  Checking the registry reveals that the 2 bars are not listed 
>> (at least there
>> is no matching BarID entry).  When I show them from my view menu the 
>> first toolbar
>> (IDR_MAINFRAME) shows up docked to the right side, not where I left it. 
>> And the
>> second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct row,
>> i.e. I moved it down to form a second row, but has moved back to its 
>> original
>> horizontal position which is right next to the first toolbar's original 
>> position.
>> Is there anything that would prevent these toolbars information being 
>> recorded?
>>
>> Thanks,
>> Drew
>
>
> Are you by chance using rebars?  If you are, the SaveBarState/LoadBarState 
> functions will not work as expected.  I too ran across this problem and 
> could not find a readily available solution so I decided to write my own 
> functions in my configuration class.
>
> -- 
> ============
> Frank Hickman
> Microsoft MVP
> NobleSoft, Inc.
> ============
> Replace the _nosp@m_ with @ to reply.


No, these are standard CToolbars.

Drew 


0
4/2/2005 12:00:12 AM
Hello Drew,

> I'm trying to use SaveBarState("BarState") and
> LoadBarState("BarState")
> to remember the state of my toolbars.  This works fine for all my
> toolbars
> except 2.  Checking the registry reveals that the 2 bars are not
> listed (at
> least there
> is no matching BarID entry).  When I show them from my view menu the
> first
> toolbar
> (IDR_MAINFRAME) shows up docked to the right side, not where I left
> it.  And
> the
> second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct
> row,
> i.e. I moved it down to form a second row, but has moved back to its
> original
> horizontal position which is right next to the first toolbar's
> original
> position.
> Is there anything that would prevent these toolbars information being
> recorded?

Typically you will run into problems if you removed a toolbar or simply change 
the id of the toolbar. Also make sure that each toolbar does have a distinct 
ID. If you are comfortable, clean up the registry under your app where toolbar 
settings are saved. This will get rid of any bad data and then try again.

-- 
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


0
ajaykalra (6842)
4/2/2005 1:35:43 AM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:17268632479845426494672@msnews.microsoft.com...
> Hello Drew,
>
>> I'm trying to use SaveBarState("BarState") and
>> LoadBarState("BarState")
>> to remember the state of my toolbars.  This works fine for all my
>> toolbars
>> except 2.  Checking the registry reveals that the 2 bars are not
>> listed (at
>> least there
>> is no matching BarID entry).  When I show them from my view menu the
>> first
>> toolbar
>> (IDR_MAINFRAME) shows up docked to the right side, not where I left
>> it.  And
>> the
>> second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct
>> row,
>> i.e. I moved it down to form a second row, but has moved back to its
>> original
>> horizontal position which is right next to the first toolbar's
>> original
>> position.
>> Is there anything that would prevent these toolbars information being
>> recorded?
>
> Typically you will run into problems if you removed a toolbar or simply 
> change the id of the toolbar. Also make sure that each toolbar does have a 
> distinct ID. If you are comfortable, clean up the registry under your app 
> where toolbar settings are saved. This will get rid of any bad data and 
> then try again.
>
> -- 
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com
>


Oh yeah, good catch Ajay, I forgot about the unique ID problem...

-- 
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


0
4/2/2005 7:19:45 AM
Hi Ajay,

"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:17268632479845426494672@msnews.microsoft.com...
> Hello Drew,
>
>> I'm trying to use SaveBarState("BarState") and
>> LoadBarState("BarState")
>> to remember the state of my toolbars.  This works fine for all my
>> toolbars
>> except 2.  Checking the registry reveals that the 2 bars are not
>> listed (at
>> least there
>> is no matching BarID entry).  When I show them from my view menu the
>> first
>> toolbar
>> (IDR_MAINFRAME) shows up docked to the right side, not where I left
>> it.  And
>> the
>> second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct
>> row,
>> i.e. I moved it down to form a second row, but has moved back to its
>> original
>> horizontal position which is right next to the first toolbar's
>> original
>> position.
>> Is there anything that would prevent these toolbars information being
>> recorded?
>
> Typically you will run into problems if you removed a toolbar or simply 
> change the id of the toolbar. Also make sure that each toolbar does have a 
> distinct ID. If you are comfortable, clean up the registry under your app 
> where toolbar settings are saved. This will get rid of any bad data and 
> then try again.
>
> -- 
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com

I have made sure that all toolbars have unique IDs (of course IDR_MAINFRAME
is used by other resources).  I have not removed or renamed any toolbars and 
I have
cleaned up the registry.  Still no luck.

Thanks,
Drew 


0
4/4/2005 4:59:11 PM

Drew Myers wrote:

> I'm trying to use SaveBarState("BarState") and LoadBarState("BarState")
> to remember the state of my toolbars.  This works fine for all my toolbars
> except 2.  Checking the registry reveals that the 2 bars are not listed (at 
> least there
> is no matching BarID entry).  When I show them from my view menu the first 
> toolbar
> (IDR_MAINFRAME) shows up docked to the right side, not where I left it.  And 
> the
> second toolbar (IDR_SECOND_TOOLBAR) toolbar shows up on the correct row,
> i.e. I moved it down to form a second row, but has moved back to its 
> original
> horizontal position which is right next to the first toolbar's original 
> position.
> Is there anything that would prevent these toolbars information being 
> recorded?

Try this, just continue through the asserts if you get them the first 
time around.

if (!m_wndToolBar.CreateEx(this, ... CBRS_SIZE_DYNAMIC,

    CRect( 0, 0, 0, 0 ), AFX_IDW_CONTROLBAR_LAST )

Add this ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For the next tool bar:

    CRect( 0, 0, 0, 0 ), AFX_IDW_CONTROLBAR_LAST - 1 )

> Drew 

Best, Dan.

0
public21 (290)
4/4/2005 8:50:52 PM
Reply:

Similar Artilces:

ToolBars
I just installed Crystal Reports on my machine. It added a Crystal Report option in my Office 2000 excel toolbar. I would like to get rid of it. When I remove it from the toolbars, it reappears when I close Excel and open up again. If I just move it to a different area on the tool bar, it reverts back to it's original location when I close and open Excel up again. Any idea how I can remove this from the toolbar or at least let it keep it settings so I can have it in a different location. Thanks, Jasper IIRC, there's an addin under Tools|addins that points at that CR dll. Maybe...

Menus, Toolbars and Keyboard shorts missing or diabled
Hi all: I have lost my menu bar, all toolbars (it is not set to full screen) and keyboard shortcuts (Alt+T, O for example) dont work. Help, please. Dudley Is it ok to trash any customizations you've made to the toolbar? If yes: close excel windows start button|Find/seach to look for *.xlb Rename it/them to *.xlbOLD (just in case) restart excel. If it worked, delete those *.xlbOLD files and rebuild your toolbars from scratch. Dudley Wright wrote: > > Hi all: > > I have lost my menu bar, all toolbars (it is not set to full screen) > and keyboard shortcuts (Alt+T, O for...

Debug vs. Release paint problem
Hello, We are developing an MFC application using VC2008. We discovered an "ugly" paint problem. It was suprising to us. that we had not discovered the problem earlier, through all of our testing. What was most suprising, was learning the fact that the problem only exists, in the debug version. The paint problem does not exist in the release version. Basically, when one of our dialog boxes is covered by different application's window, a part of the dialog box does not get repainted, and it shows a default brush color. Unfortunately, the brush color is not the sa...

How do I remove "Fix" from my bottom toolbar?
I am trying to get rid of "fix" as it appears next to the NUM & SCRL indicators on the bottom right hand side of the screen. How do I remove FIX??? Hi! That means you have Fixed Decimal Places set. Goto Tools>Options>Edit Uncheck Fixed Decimal Places Biff "Swaytan" <Swaytan@discussions.microsoft.com> wrote in message news:77E0C9A8-54D3-411A-A9F9-95066B111E5C@microsoft.com... >I am trying to get rid of "fix" as it appears next to the NUM & SCRL > indicators on the bottom right hand side of the screen. How do I remove > FIX??? ...

still problem in Exchange server 2003
Dear All, I was posted the below message before some days and infact unfortunately no solution tell now the new thing I want to say that the problem solved for 3 days and come back again without any changing also I want to say that the queue nothing strainge in it except that our message status is alot of them have " Retry" and the result is failur and the log of my event viewer has a lot of event :The connection was dropped by the remote host.as below and I don't want to reinstall my alone exchange server 2003. so please Help by details even it diffecult but it will be sooooooo...

Problem with partial validation
I have a problem when I select node elements from an xml file and validata each node againts the schema. I use XmlValidatingReader and it complains about elements not being declared. I have defined a schema for details of a particular service request. Below is a schema similar to the one that I defined: <?xml version="1.0" standalone="yes" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.mycompany.com" xmlns="http://www.mycompany.com" xmlns:dsc="http://www.mycompany.com" xmlns:mspr...

How can I set Outlook, I have problems with that.
I Try to use Outlook in my PC but I don't have a clue to set Outlook, I know if I can set the program I see my mail bye Outlook but is difficult to me understand... please can you help me how to set the program step by step? Thanks... You will need the server names from your ISP in order to set it up. We cannot help you with that. Most ISPs will post instructions on how to setup Outlook Express (they will not support Outlook) but you can use the same information to set up Outlook account(s). --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion in...

Help with attachment blocking (odd problem)
Hello, We are having problems with *something* blocking our emails that contain html attachments. This is not a problem internally. This only occurs when attempting to send them out of our network. Occasionally these messages will go trhough but duplicate on the receivers end. The messages continually retry (on our relay server) and eventually bounce back after the 2 day timeout. I have tested multiple emails with differen't attachments, no attachments, etc -- the only attachment with this issue is in html format. I cannot find where these attachments are being blocked. We have two MS I...

problem exiting outlook
Hi, I recently upgraded to office 2003, and im having problems with outlook 2003. When I exit outlook (whether I'm online, offline, use the X, file-exit, or alt-f4) it doesn't close correctly. The window is gone, but the outlook icon still hangs in the system tray, and when double-clicking on it it says outlook is not responding. After this Outlook will not start up again, unless i go into Task Manager-Processes and end the process OUTLOOK.exe manually. I've been told the add-ins could block the correct functioning of the exiting, but i disabled all the add-ins and r...

Short Course booking problem
Simple problem (to you, I'm sure):- Local tennis club running a 3 week short course that runs am and pm, so he has about 100 names and other data (eg DOB, Phone no. etc) and against each name the week booked and whether am or pm. What's need is a way to list everyone who should be there eg on a given afternoon. I have suggested it needs each session numbered, but with 2 sessions a day this means a lot more data input. Eg someone doing morning sessions for the first week would need to add sessions 1,3,5,7,9. OH! I guess they would each have to be in a different column - ugh! I can'...

runtime xp problem
Hi, I just upgraded my IDE to Access 2003. My customers have XP runtime installed. As I know - the file format for ADP\ADE didn't change. But when I create an ADE with 2003 I cant open it using XP runtime. I get the "Unrecognized database formt" messeage. When I open the same file using Access XP and create the ADE file - all works OK. Any ideas anyone ? The binary format is different with A2002 and A2003. As a result, an MDE/ADE created with A2003 cannot be used by any earlier version. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users -...

Windows 98 Shutdown Problem
Hello I have an application that is running in System Tray. It is a plain win32 application with Window Proc like this (Pseudo Code) mywndproc() { switch( nMsg) { case WM_CLOSE : PostQuitMessage(0); return 0; break; case WM_COMMAND: .............. }; return DefWindowProc(hwnd, nMsg, wParam, lParam); } Now the application does not shutdown on Windows 98 and ME. I am passing all the messages to DefWindowProc and it is the only one which is returning any value in Windows Proc Function. Regards Shrishail Rana You must respone to the WM_DESTORY message, not the WM_CLOSE message ...

facing problem with outlook express
hi all, one of my user using outlook express as client. os is windodws 2000 professional now his system is crashed. is there any folder which stores mails like outlook to restore mails. please help me thanks, shiva ...

Outlook 2003 -- read receipt problem
Hello, I have placed this question several times before without any luck: I also noticed that after a "Read Receipt" is sent, the message is not present in the "Sent" folder. I want to be able to have a copy of the sent message. How can I accomplish this ? I have a "read receipt" in the "Outbox" and can not get rid of it because is not visible (there is nothing in the folder) and keeps trying to send it every "Send and Receive" How can I get rid of the hidden message (without allowing it to go out)? Thanks Previous post: ===============...

[ANN] How-To: Dealing with error messages and solving problems
Today's article outlines how to find help when you receive an error or if you are experiencing problems. Before asking on a mailing list, newsgroup or calling support, check the Error Page or the Solve Crashes & Conflicts Page. Searching for answers if often the quickest way to find an answer, plus when you search for answers yourself you often find other bits of useful info along the way. Don't expect someone else to always provide the answers. For example: You receive the error "The action could not be completed. An unknown error (4362) occurred." How do you find what ...

Problem Posting Batch in Great Plains Dynamics
When I try to post any batch in Dynamic, after a fresh install, I am getting an error The stored procedure glp batch cleanup returned the following results: DBMS:0, GREAT PLAINS:20488 Thanks in advance for any input! Which version of GP you are using ? Did you install any service pack recently ? if so, run special upgrade procedure in the Great Plains Utilities. updates the client compuetrs also with the same SP. BS "ACMEBRAD" <ACMEBRAD@discussions.microsoft.com> wrote in message news:4FF4DC96-11AC-4425-B52E-530BDEFF7264@microsoft.com... > When I try to post any ba...

451 Temporary local problem
Hi all Lately i've been getting this message back when i try to send e-mail. It's annoying as hell to say the least as the mail server i use is fine and has been behaving itself. Any idea's ?? I running XP proff on a laptop with NAV 2002 running. Thanks andrew Well, if you're getting that error message, the mail server you use is *not* fine - that's your server saying that it can't handle mail right now. Contact your mail service provider and ask what's going on. -- Jeff Stephenson Outlook Development This posting is provided "AS IS" with no war...

Resource file problems.
For some reason my resource file changes on it's own. On compiling I get an error as unknown resource for "HIDC_CAPTION_EDIT". I opened the file ran a "replace all" on it to change it back to "IDC_CAPTION_EDIT". Everything works fine the next time I make any changes to my resources I get the same error and it has been changed back again! I know the res file is being updated but where do I look for the cause and fix it? Thanks, Mark If what you are saying is that you have "HIDC_CAPTION_EDIT" defined in the resource.h file, and are changing it ...

I have problems
I am running Money 2003. Under my 401k account, I updated the prices of my securities, but for some reason, the software wants to include how much cash I have invested as well, which skews how much I actually have in the account upward. how do I get the software to NOT add in the cash I have invested? Huh? Are you updating prices or investment values? How are you accounting for your contributions? Are you transferring cash in and not buying investments with this cash and then using the wizard or update account to tell Money that this money has morphed into investments? "thomas&...

Problem updating Service reference
Hello, I have a vb2008 solution with a WCF service project and UI project, the service project and UI project has a reference to a core project, that's project has one class usable for UI and service and referenced into all, went I try to update a service reference in UI project, appears a new datasource in service reference / Reference.svcmap, into UI project the calls to common class appears with at "not a member" error, and the cast lines between types of service core class and ui core class fails with "cannot be converted to" error because ui cla...

PUBLIC FOLDER PROBLEMS #4
Hi, Using SBS 2003, exchange public folder get's corrupted periodically (every six month or so), in where I , as owner of publick folder object, cannot add additional records (messages, or emails) to public folder folders. Messages I get : Can't copy the items. Cannot complete the copy operation. The items may have been moved or deleted or you may have not sufficient permissions. I am copying them from my send items folders to a public folder. Any clues why?? I do notice I can copy some records, and some records not. Before I would re-populate the poblick folder from a backup pst...

Outlook 2000 "Out of memory or system resources" problems
OS: Win XP Pro CPU/Ram: 1.3M Presario Laptop 256MB RAM I run Win XP Pro on Pentium 1.3M with 256MB Ram, I'm getting "out of memory or low in system resources" error while using OUTLOOK 2000. Some folders don't open and and I can't move items between folders. This started just 1 week ago. I've tried updating Office to with SR1 update. It was successful though I got one error "cannot apply patch to C:\config.msi\pt472.tmp....." saying patch may have been applied by other setup... I've tried reinstalling my McAfee virusscan, repairing office(whic...

SMTP Problem
Hello, I am having something weird that I cannot resolve. A couple of weeks ago I added a second Exchange server with Enterprise Ed. in the same site. The problem now is that I am ready to decommission the original Exchange server but it seems that the new Exchange server uses the old one to relay SMTP to external addresses. For example: If I turn off my SMTP on the original Exchange server, I see mail being held in cue on my new exchange server, but as soon as I turn it on, on the old one, the mail starts getting delivered I do notice that on the logs also. Could some please help ...

Payee Problem
I'm using Money 2003 Deluxe. When I go to the payee list, certain active payees are not displayed. Also auto complete doesn't display the name while typing, even tho a transaction with that name has been recently entered. If I'm in the payee list and try to rename another payee to the payee above, it tells me that the payee name is already being used as a payee or payee name variation. When I look at the preferred payee names, that name is not listed as a variation either. If I click on the transaction in the register and then click on the payee box, the payee name d...

Printing Problems #5
Hi there I have a problem with Excel. Everytime i print the print out is not the same as the print preview. The alignment is totally out. I have printed the same document from a laptop and matched up the settings exactly but the error still persist. I have printed with differnet PC and it has the same problem, but there is one PC the Prints perfectly. Is there a setting for adjusting the alignment for only one section of Excel. Or is it the printer that is causing problems. Without knowing any of the real specifics, I'd guess it was a variation of the printer or printer driver. Ca...