Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to use CreateAsBinaryFile?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to use CreateAsBinaryFile?

 Post Reply Post Reply
Author
Message
Micca View Drop Down
Groupie
Groupie


Joined: 26 November 2008
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Micca Quote  Post ReplyReply Direct Link To This Post Topic: How to use CreateAsBinaryFile?
    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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.