This is the piece of code I had written to write to the config file
wxFileInputStream NamesStream("config.txt");
wxFileConfig *ConfigNames = new wxFileConfig(NamesStream);
bool b = ConfigNames->Write("ramu","ramu@123");
The return value is true but it doesn't write anything to the file.
I don't have any problem reading from the config file. Can somebody tell me whats the problem with Writing to config file.
Writing to config file Topic is solved
I usually work with std:: o/ifstream for writing/reading files.
So I am not familiar with the wxFile stuff.
Acutally, if I look at the Docs, wxFileConfig::Save could be worth a try.
http://wxwidgets.org/manuals/2.6.2/wx_w ... configsave
phlox
So I am not familiar with the wxFile stuff.
Acutally, if I look at the Docs, wxFileConfig::Save could be worth a try.
http://wxwidgets.org/manuals/2.6.2/wx_w ... configsave
phlox
-
- Earned some good credits
- Posts: 113
- Joined: Sat Jan 07, 2006 7:22 pm
- Location: Grenoble (FRANCE)
Here is the code I use (after been helped on this forum)
If this can help you....
Code: Select all
wxFileConfig * file_config = new wxFileConfig(wxEmptyString, wxEmptyString,"My PATH");
file_config->SetPath("/My GROUP NAME");
file_config->Write("My KEY NAME", "String to add");
file_config->Flush();