I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting Windows, I'd prefer to use a configuration (eg .ini) file. Does anyone know a clean and simple way of doing this ? Thanks.
views:
421answers:
2
+2
A:
According to the source of wx/config.h file, all you need is to define the wxUSE_CONFIG_NATIVE symbol to 0 in your project and then it will always use wxFileConfig.
Paulius Maruška
2008-09-08 07:27:38
Thanks for this, it didn't quite work exactly but did point me in the right direction. Instead of undefining wxUSE_CONFIG_NATIVE, redefining wxUSE_CONFIG_NATIVE from its default of 1 to 0 instead does work.
Bill Forster
2008-09-08 10:28:34
Oh and of course if you edit the post to indicate that you need to define wxUSE_CONFIG_NATIVE to 0, I will accept the answer.
Bill Forster
2008-09-09 01:09:39
+1
A:
The cleanest and simplest way is to use wxFileConfig class.
Milan Babuškov
2008-09-18 10:18:24