15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Toolbars (SaveBarState, LoadBarState)

Robertson David -- davidr@devmail.sps.mot.com
Thursday, April 25, 1996


     VC++ 4.1
     WinNT/Win95
     
     Ok everyone, what am I doing wrong. I have several toolbars in my 
     CMainFrame which are all enabled for docking. Everyone docks and 
     floats as desired while running. In CMainFrame::OnClose, I call 
     SaveBarState. In CMainFrame::OnCreate, after toolbar creation and 
     docking calls, I call LoadBarState. If my bars are floating, all
     works fine. If my bars are docked, they dock, but not where I had
     put them. I looked at the VC++ sample DOCKTOOL, to see what they
     did there. I implemented the approach they had used and still did
     not get the desired results. The fact that DOCKTOOL had to use other
     means than just SaveBarState and LoadBarState tells me there is
     something going on.
     
     What is the best way to save/restore the toolbar states?
     
     
     Thanks all...
//==================================================//
//  David Robertson     davidr@devmail.sps.mot.com  //
//                      davidr@inetport.com         //
//==================================================//

     



Dan Kirby -- dkirby@accessone.com
Monday, April 29, 1996

You're not going to like this answer, but there are some big problems with 
the LoadBarState() and SaveBarState() functions.  The biggest problem is 
that everytime that you save and load the states, the .INI file will grow 
larger and larger consuming more and more memory everytime the states are 
loaded.  There is NO work-around.  You need to know about this if you are 
going to be thinking about using these functions.  Right now, there is no 
good solution for saving and loading control bar states.

--dan




----------
From: 	Robertson David[SMTP:davidr@devmail.sps.mot.com]
Sent: 	Thursday, April 25, 1996 3:23 AM
To: 	mfc-l@netcom.com
Subject: 	Toolbars (SaveBarState, LoadBarState)


     VC++ 4.1
     WinNT/Win95

     Ok everyone, what am I doing wrong. I have several toolbars in my
     CMainFrame which are all enabled for docking. Everyone docks and
     floats as desired while running. In CMainFrame::OnClose, I call
     SaveBarState. In CMainFrame::OnCreate, after toolbar creation and
     docking calls, I call LoadBarState. If my bars are floating, all
     works fine. If my bars are docked, they dock, but not where I had
     put them. I looked at the VC++ sample DOCKTOOL, to see what they
     did there. I implemented the approach they had used and still did
     not get the desired results. The fact that DOCKTOOL had to use other
     means than just SaveBarState and LoadBarState tells me there is
     something going on.

     What is the best way to save/restore the toolbar states?


     Thanks all...
//==================================================//
//  David Robertson     davidr@devmail.sps.mot.com  //
//                      davidr@inetport.com         //
//==================================================//






begin 600 WINMAIL.DAT
M>)\^(B4$`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$(@ <`
M& ```$E032Y-:6-R;W-O9G0@36%I;"Y.;W1E`#$(`0V ! `"`````@`"``$$
MD 8`I (```(````,`````P``, ,````+``\.``````(!_P\!````/P``````
M``"!*Q^DOJ,0&9UN`-T!#U0"`````&UF8RUL0&YE=&-O;2YC;VT`4TU44 !M
M9F,M;$!N971C;VTN8V]M```>``(P`0````4```!33510`````!X``S !````
M$0```&UF8RUL0&YE=&-O;2YC;VT``````P`5# $````#`/X/!@```!X``3 !
M````$P```"=M9F,M;$!N971C;VTN8V]M)P```@$+, $````6````4TU44#I-
M1D,M3$!.151#3TTN0T]-`````P``.0`````+`$ Z`0````(!]@\!````! ``
M``````,-`````P``, 0````+``\.`0````(!_P\!````4P````````"!*Q^D
MOJ,0&9UN`-T!#U0"```!`&1A=FED``$P`0```!T````G9&%V:61R0&1E=FUA:6PN
M
M`!X,`0````4```!33510`````!X`'PP!````%0```&1K:7)B>4!A8V-E``@0`0```&4```!93U5214Y/
M5$=/24Y'5$],24M%5$A)4T%.4U=%4BQ"55142$5214%215-/345"24=04D]"
M3$5-4U=)5$A42$5,3T%$0D%24U1!5$4H*4%.1%-!5D5"05)35$%412@I1E5.
M0U1)``````(!"1 !````,04``"T%```_"@``3%I&=?4>B'C_``H!#P(5`J0#
MY 7K`H,`4!,#5 (`8V@*P'-E=.XR!@`&PP*#,@/&!Q,"@T8S`\4"`'!R<1(B
M?,C4U`H '"H$-L0M@;F460)!@%V92&Y9G5N8P1T:0(@2/0^Q_A)<-Y"& ?L"*Q(E,7,&\AD"$C%3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co.uk
Tuesday, April 30, 1996

In-Reply-To: <01BB3613.1B6E1BA0@dkirby.accessone.com>
> You're not going to like this answer, but there are some big problems 
> with the LoadBarState() and SaveBarState() functions.  The biggest 
> problem is that everytime that you save and load the states, the .INI 
> file will grow larger and larger consuming more and more memory 
> everytime the states are loaded.  There is NO work-around.  You need to 
> know about this if you are going to be thinking about using these 
> functions.  Right now, there is no good solution for saving and loading 
> control bar states.
> 
> --dan
This is not true with Visual C++ v4.1
The bug has been fixed! I have checked this on NT3.51, NT4.0 beta and 
Windows 95. All that is required is the new MFC dll and even old 
executables will removed the bug.




Dan Kirby -- dkirby@accessone.com
Thursday, May 02, 1996

Unfortunately, a problem still exists with VC++ 4.1

To repro:

***
Run docktool sample.
Dock the palette bar (the one on the right) to the bottom dock bar.
Exit
record ini file size
Run docktool sample again and exit
note ini file size has grown by 23 or so bytes.

The ini file will continue to grow with each run.
***
Generally speaking I think there is only a problem when you move a toolbar 
on the left or right side to the top or bottom. Whether you experience the 
problem depends upon what you do with the toolbars.  You might be able to 
do something that goes out to the .INI file a strips out duplicates or does 
some cleanup work before loading the information.

But, the fact remains that the problem still exists with VC++ 4.1. The MFC 
team is aware of the problem but no fix exists at this time.

--dan

----------
From: 	Iain Waddell[SMTP:iain@cix.compulink.co.uk]
Sent: 	Tuesday, April 30, 1996 4:09 PM
To: 	mfc-l@netcom.com
Cc: 	iain@cix.compulink.co.uk
Subject: 	RE: Toolbars (SaveBarState, LoadBarState)

In-Reply-To: <01BB3613.1B6E1BA0@dkirby.accessone.com>
> You're not going to like this answer, but there are some big problems
> with the LoadBarState() and SaveBarState() functions.  The biggest
> problem is that everytime that you save and load the states, the .INI
> file will grow larger and larger consuming more and more memory
> everytime the states are loaded.  There is NO work-around.  You need to
> know about this if you are going to be thinking about using these
> functions.  Right now, there is no good solution for saving and loading
> control bar states.
>
> --dan
This is not true with Visual C++ v4.1
The bug has been fixed! I have checked this on NT3.51, NT4.0 beta and
Windows 95. All that is required is the new MFC dll and even old
executables will removed the bug.





begin 600 WINMAIL.DAT
M>)\^(C0%`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$(@ <`
M& ```$E032Y-:6-R;W-O9G0@36%I;"Y.;W1E`#$(`0V ! `"`````@`"``$$
MD 8`/ (```(````,`````P``, ,````+``\.``````(!_P\!````/P``````
M``"!*Q^DOJ,0&9UN`-T!#U0"`````&UF8RUL0&YE=&-O;2YC;VT`4TU44 !M
M9F,M;$!N971C;VTN8V]M```>``(P`0````4```!33510`````!X``S !````
M$0```&UF8RUL0&YE=&-O;2YC;VT``````P`5# $````#`/X/!@```!X``3 !
M````$P```"=M9F,M;$!N971C;VTN8V]M)P```@$+, $````6````4TU44#I-
M1D,M3$!.151#3TTN0T]-`````P``.0`````+`$ Z`0````(!]@\!````! ``
M``````,,`````P``, 0````+``\.`0````(!_P\!````3P````````"!*Q^D
MOJ,0&9UN`-T!#U0"```!`&EA:6Y 8VEX+F-O;7!U;&EN:RYC;RYU:P!33510
M`&EA:6Y 8VEX+F-O;7!U;&EN:RYC;RYU:P``'@`", $````%````4TU44 ``
M```>``,P`0```!D```!I86EN0&-I>"YC;VUP=6QI;FLN8V\N=6L``````P`5
M# (````#`/X/!@```!X``3 !````&0```&EA:6Y 8VEX+F-O;7!U;&EN:RYC
M;RYU:P`````"`0LP`0```!X```!33510.DE!24Y 0TE8+D-/35!53$E.2RY#
M3RY52P````,``#D`````"P! .@`````"`?8/`0````0````````$;VJ1C$<^2*$1%4U0`````'@`># $````%````4TU4
M4 `````>`!\,`0```!4```!D:VER8GE 86-C97-S;VYE+F-O;0`````#``80
M8<_W5P,`!Q"8!0``'@`($ $```!E````54Y&3U)454Y!5$5,62Q!4%)/0DQ%
M35-424Q,15A)4U135TE42%9#*RLT,51/4D504D\Z*BHJ4E5.1$]#2U1/3TQ3
M04U03$5$3T-+5$A%4$%,151414)!4BA42$5/3D5/3E1(10`````"`0D0`0``
M`.,%``#?!0``D0H``$Q:1G6 -N'@_P`*`0\"%0*D`^0%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O0WLO\AT#@2*V%(@B+S35!&(DL4WT13?;*S+0K "& K8$"U)& )@/LE8GVW:RQ !^ !H$.C4L+_!I WHU R?O=!
M@36#-2*6U+YU`)!(U!'PC$F%^5(YX_^6D4L3-A11H4-0!' ND0I _TFR** N
M[ U,1NPJ0`=X-XP07$!D"M#"H57"X A0-)W!" Y-3O 04V!0P/S
M-D$6`'%U?("5D8AS?I'[!]%/4F1-@2M3.! #H ;P_ZI73; %D$.P0;(=(DV!
M2\'_. &*Y*91+RUW;WA^&C58!@L*A14A`+8```,`$! ``````P`1$ $```! 
M```#T``0````4```!213H@``````,`
(#33]-P```U


Bill McGarry -- billm@isc-br.isc-br.com
Friday, May 10, 1996

At 10:21 PM 5/2/96 -0700, Dan Kirby wrote:
>Unfortunately, a problem still exists with VC++ 4.1
>
>***
>Run docktool sample.
>Dock the palette bar (the one on the right) to the bottom dock bar.
>Exit
>record ini file size
>Run docktool sample again and exit
>note ini file size has grown by 23 or so bytes.
>

I can also confirm that the problem exists in VC++ 4.1.  I talked to MS
Support; there is no solution right now but the person that I talked to will
try to fix the problem the early part of the week (5/13 week).  As soon as I
hear anything, I'll post it to MFC-L.


Bill McGarry
Olivetti North America



and someone there will 




Bill McGarry -- billm@isc-br.isc-br.com
Monday, May 20, 1996

At 10:21 PM 5/2/96 -0700, Dan Kirby wrote:
>Unfortunately, a problem still exists with VC++ 4.1
>
>***
>Run docktool sample.
>Dock the palette bar (the one on the right) to the bottom dock bar.
>Exit
>record ini file size
>Run docktool sample again and exit
>note ini file size has grown by 23 or so bytes.

Microsoft Developer Support got back to me after 2 or 3 days with a fix for
this problem.  I've tried the fix with the docktool sample and with my own
project and it seems to have fixed the problem completely.  The fix is now
going through further testing at Microsoft and should be posted to the
Knowledge Base any day now.  I felt that it would be better to wait for the
final version to come out from Microsoft before I post any code here which
may still have a problem.  If I don't see the fix show up on the Knowledge
Base in the next few days, then I will post the version that I received.
(If anyone needs this fix desperately, just let me know.)

Bill McGarry
Olivetti North America
billm@mail.isc-br.com





| Вернуться в корень Архива |