How to use CreateAsBinaryFile? |
Post Reply |
Author | |
Micca
Groupie Joined: 26 November 2008 Status: Offline Points: 22 |
Post Options
Thanks(0)
Posted: 29 March 2010 at 6:42am |
hi,
i wanna save/load the layout of my 4 commandbars into/from the same binary file. I use VB6 with Commandbars 12.1.1 and this is my code for loading and saving to a binary file: ' SAVE Dim pxWrite As PropExchange Set pxWrite = XtremeCommandBars.CreatePropExchange pxWrite.CreateAsBinaryFile False, App.Path & "\Toolbar.dat" ExchangeState pxWrite, cbrMain ExchangeState pxWrite, cbrDrives ExchangeState pxWrite, cbrFiles ExchangeState pxWrite, cbrReport ' LOAD Dim pxRead As PropExchange Set pxRead = XtremeCommandBars.CreatePropExchange If (pxRead.CreateAsBinaryFile(True, App.Path & "\Toolbar.dat")) Then ExchangeState pxRead, cbrMain ExchangeState pxRead, cbrReport ExchangeState pxRead, cbrDrives ExchangeState pxRead, cbrFiles End If Private Sub ExchangeState(ByRef px As PropExchange, ByRef Toolbar As CommandBars) Dim pxSection As PropExchange Dim Options As StateOptions Set Options = Toolbar.CreateStateOptions Options.SerializeControls = True Options.SaveOnlyCustomized = True Options.SaveOriginalControls = False Options.SerializeOptions = True Options.SerializeLayout = True Set pxSection = px.GetSection(Toolbar.name) Toolbar.DoPropExchange pxSection, Options End Sub When loading from the binary file the changes of an toolbar always will be visible at an other toolbar. Let's say i change toolbar cbrMain and save all toolbars. When loading the changes will be visible at toolbar cbrReport. Anyone can help? |
|
Micca
--------------------- Product: Xtreme Commandbars (ActiveX) Version 17.2 Platform: Win7 64bit Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |