Guidance Forums / wxWidgets (wxWindows) in C++ / Problem using wxFileConfig

Search 搜索
Home Home

Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problem using wxFileConfig
Posted by: 2004-04-22 20:24:16
Well, first, sorry for my horrible english... I have one problem. Well, i have a lot of!! ;)

I was reading this post,3119,3122

becouse i have the same problem. Finally, i could try the wxIniFile class correctly but it is incomplete. Then, i try the wxFileConfig, witch is multiplataform compatible (the other no). But i don't know how to initialize them!! I haven't any error but the constructor never make the my config file. Can anybody give me a small example?

Thank you :)
Message2. Anybody?
Posted by: 2004-04-23 20:19:24
Anybody can give me a small sample? Only constructor...
Message3. Re: Problem using wxFileConfig
Posted by: mooncake 2004-04-24 02:06:30
1 day passed and you did not even go to look in the sources how the constructor works? :p

  wxFileConfig(const wxString& appName = wxEmptyString,
               const wxString& vendorName = wxEmptyString,
               const wxString& localFilename = wxEmptyString,
               const wxString& globalFilename = wxEmptyString,
               long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
               wxMBConv& conv = wxConvUTF8);
Message4. Re: Problem using wxFileConfig
Posted by: 2004-04-25 22:39:48
Oh, sorry... I have not explained well. Yes, i looked the sources and the constructor, but it not works. I try with a lot of possibilities but nome works correctly. The constructor don't make the file on my HD and i can't work with the object. I do not know that happens. If you can give me an small sample of the constructor... I only want to know how to make a local config file (in the app directory).

Sorry for my form of expressing. Thank you
Message5. Re: Problem using wxFileConfig
Posted by: 2004-05-13 18:41:01
wxFileConfig *ini = NULL;
//the third parameter is a local filename, make sure
// not to use the wrong slash '\' use only '/'
//you can skip the fourth parameter as it will be set to this automaticly anyway
ini = new wxFileConfig("","","c:/myapp/config.ini","",wxCONFIG_USE_LOCAL_FILE);


Message6. Re: Problem using wxFileConfig
Posted by: chot 2004-05-14 01:14:38
i have had some other problems with the wxFileConfig (not saving correctly) so i would recomend you to use xml, if you are going to save anything that is a bit more complicated than 4 strings and an int.
i use and like libxml2
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
© Mon 2024-6-17  Guidance Laboratory Inc. Hits:0