Saving CToolbar's state, Bug? 
Author Message
 Saving CToolbar's state, Bug?

The following code should save the state of all toolbars defined in
CMainFrame.
        CDockState bstate;
        GetDockState (bstate);
        bstate.SaveState ("ToolBars");
        ...
        and corresponding LoadState

This works fine. This is for the standard toolbar and the statusbar.
When I add a new toolbar of class CToolBar, the toolbars get confused.
This is the original toolbar gets the position of the new toolbar and
the latter is displayed at the top/left corner.

Does anybody has similar experience? Is this a bug?
The INI shows more entries that I think is necessary.

Shui



Sat, 11 Sep 1999 03:00:00 GMT  
 Saving CToolbar's state, Bug?

Quote:

> When I add a new toolbar of class CToolBar, the toolbars get confused.
> This is the original toolbar gets the position of the new toolbar and
> the latter is displayed at the top/left corner.

Make sure your toolbars have unique child-ids.  Sounds like they're both
storing information with the same identification.  -steve
--
McAdams Research
MFC GUI Toolkit [http://home.sprynet.com/sprynet/smcadams]


Sun, 12 Sep 1999 03:00:00 GMT  
 Saving CToolbar's state, Bug?

The key is in the toolbar's ID.  Be sure that you've given your new
toolbars a unique ID in the Create method.

Kelli

--

http://www.inlet.com

Quote:

> The following code should save the state of all toolbars defined in
> CMainFrame.
>         CDockState bstate;
>         GetDockState (bstate);
>         bstate.SaveState ("ToolBars");
>         ...
>         and corresponding LoadState

> This works fine. This is for the standard toolbar and the statusbar.
> When I add a new toolbar of class CToolBar, the toolbars get confused.
> This is the original toolbar gets the position of the new toolbar and
> the latter is displayed at the top/left corner.

> Does anybody has similar experience? Is this a bug?
> The INI shows more entries that I think is necessary.

> Shui



Sun, 12 Sep 1999 03:00:00 GMT  
 Saving CToolbar's state, Bug?



Quote:
> The following code should save the state of all toolbars defined in
> CMainFrame.
>    CDockState bstate;
>    GetDockState (bstate);
>    bstate.SaveState ("ToolBars");
>    ...
>    and corresponding LoadState

> This works fine. This is for the standard toolbar and the statusbar.
> When I add a new toolbar of class CToolBar, the toolbars get confused.
> This is the original toolbar gets the position of the new toolbar and
> the latter is displayed at the top/left corner.

> Does anybody has similar experience? Is this a bug?
> The INI shows more entries that I think is necessary.

Yes, this is a bug. See MS article Q151446. This bug is suppose
to have been corrected in MFC 4.2. Incidentally, the workaround
that was published did not seem to work :-(

Paul.



Mon, 13 Sep 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Saving and retrieving the state of toolbars CToolBar

2. saving CToolBar state

3. Saving/Restoring CToolBar's old position

4. Bug in MFC - Can't save document

5. CToolbar--How to set the HOT state?

6. CToolBar with two state buttons

7. CToolBar selection state drawing problem!!

8. CToolBar button click focus state problem

9. How to save CToolBar object location?

10. Window state save/restore

11. Saving state and returning from any location in program

12. Saving the State of the Processor

 

 
Powered by phpBB® Forum Software