Print Page | Close Window

How to use CreateAsBinaryFile?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16536
Printed Date: 22 September 2024 at 6:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use CreateAsBinaryFile?
Posted By: Micca
Subject: How to use CreateAsBinaryFile?
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net