Difference between revisions of "User:Woozle/VB/Settings manager"
(→Code: moved code to separate page) |
(→Overview: moved code notes to source code page) |
||
Line 4: | Line 4: | ||
The settings are saved in [[XML]] format, courtesy of [[Microsoft]]'s baffling and largely undocumented [[MSXML2]] [[ActiveX]] interface from the "Microsoft XML, v3.0" library (filename is c:\windows\system\MSXML3.DLL), although the classes are intended to be pluggable on both ends (you should be able to swap out the XML code for code that handles other formats, as well as being able to add "savers" for more data types). | The settings are saved in [[XML]] format, courtesy of [[Microsoft]]'s baffling and largely undocumented [[MSXML2]] [[ActiveX]] interface from the "Microsoft XML, v3.0" library (filename is c:\windows\system\MSXML3.DLL), although the classes are intended to be pluggable on both ends (you should be able to swap out the XML code for code that handles other formats, as well as being able to add "savers" for more data types). | ||
− | |||
− | |||
==Bugs== | ==Bugs== | ||
Items deleted from the saver-list may still be saved; something inside the XML objects is remembering them. You have to destroy the main Setting object and rebuild it at save-time in order to prevent this from happening. Fortunately, this doesn't seem to slow anything down noticeably. | Items deleted from the saver-list may still be saved; something inside the XML objects is remembering them. You have to destroy the main Setting object and rebuild it at save-time in order to prevent this from happening. Fortunately, this doesn't seem to slow anything down noticeably. |
Latest revision as of 23:23, 1 January 2007
Overview
This is a set of classes for automating the loading and saving of user settings in a VB application. It's not as fully-developed as the ones I wrote in C++, but it seems to have gotten to the point of being usable.
The settings are saved in XML format, courtesy of Microsoft's baffling and largely undocumented MSXML2 ActiveX interface from the "Microsoft XML, v3.0" library (filename is c:\windows\system\MSXML3.DLL), although the classes are intended to be pluggable on both ends (you should be able to swap out the XML code for code that handles other formats, as well as being able to add "savers" for more data types).
Bugs
Items deleted from the saver-list may still be saved; something inside the XML objects is remembering them. You have to destroy the main Setting object and rebuild it at save-time in order to prevent this from happening. Fortunately, this doesn't seem to slow anything down noticeably.
Code
- sample code: how to use the class collection
- source code: the classes themselves