• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Find & Replace in VB6

Even Microsoft have realised how absurd a central storage of configuraion settings is. Especially when it can't be backed up or restored. The new fashion is the old fashion to use local config files! This is what server 2008 is doing with its new components (xml config files). There will probably be a Microsoft patent on this amazing concept soon despite being industry standard for *nix.

Use the API SHGetSpecialFolderLocation with enum CSIDL_APPDATA to get 'C:\Documents and Settings\username\Application Data' or equivilent and store your configuration there.

Yeah I know - piece of cake from .net framework but not so easy from VB6.

The REGISTRY has it's good points (central, easy to find) but the monolithic binary formatted beast typified a lot of MSs design thinking at the time.

XML config isn't perfect either (lots of little unmanaged XML files all over place).

Maybe an XML-based registry in a database? But I swore I'd never, ever store XML in a database!

Ok, how about INI files?
 
I always read everything from plain old text files (except not with .txt exn as people fiddle) paths, form colours/backgrounds, images, sounds, number/size/positions of controls etc. Makes s/w a lot more flexible for updates.
 

Advertisers

Back
Top