Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Problem using wxFileConfig

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problem using wxFileConfig
#3892
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

http://g.yi.org/forum/read.php?13,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?
#3904
Posted by: 2004-04-23 20:19:24
Anybody can give me a small sample? Only constructor...
Message3. Re: Problem using wxFileConfig
#3905
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);
Meow~
Message4. Re: Problem using wxFileConfig
#3925
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
#4105
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);

ini->Write("key","value");

//enjoy
Message6. Re: Problem using wxFileConfig
#4110
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
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2022-9-28  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0