I am trying to use persistence to save the state of my menus to an INI file when my application closes, but when the app does close it throws an error as it tries to write the file. Do the Key & Section properties need full paths to the place where the INI file are to be saved?
I thought it was a simple question but obviously it doesn't seem to merit a reply!
I want to use an INI file to save the state of the menus I have setup my question is what location is the INI file that has that information and do I need to add a path?
When I have persistence enabled and locatio set to plniFile I get an exception when my application closes and the INI file is being written.
I would really appreciate some guidance as there is no help in your documentation on this.
Still hoping someone will answer this.
I've obviously upset the TMS support team as another couple of weeks have gone by, but hopefully I'll get an answer before Christmas.
First of all, it is not clear what you mean with persisting menu item states and on TAdvMainMenu there is no persistence. The closest persistence capability I know of is persistence of TAdvDockPanel. This persists position of toolbars on dockpanels. With this persistence, we could not reproduce a problem. Test app can be downloaded here:
All I mean by "persistence" is that the menu I presume, saves how it's been configured, and when you close your application it saves this information to either the registry or an .ini file.
When you restart your application (presumably) the component looks in the registry or reads an .ini file and restores how the menu was configured when it was last used.
All I want to know is how do I use this feature of saving menu settings to an .ini file?
I tried and couldn't save anything - what should the path be?
You can choose the path you want. If you want to use an INI file, the full filename (incl. path) can be set via the .Key property.
Did you check the sample download?
Yes I have downloaded the simple demo you kindly put together.
When I was adding a key value I didn't prefix it with a ".\", neither did I give it a ".ini" extension which was obviously the problem.
Thank you once again