wxFileConfig example?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Anthony11
Knows some wx things
Knows some wx things
Posts: 30
Joined: Sun Jul 05, 2015 7:14 am

wxFileConfig example?

Postby Anthony11 » Fri Jul 10, 2015 12:24 pm

can someone write or find an example for wxFileConfig read/write, pretty please?

[ininame]
iniarg1=value1
iniarg2=value2
iniarg3=value3

User avatar
doublemax
Moderator
Moderator
Posts: 11290
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxFileConfig example?

Postby doublemax » Fri Jul 10, 2015 12:52 pm

Use the source, Luke!

Anthony11
Knows some wx things
Knows some wx things
Posts: 30
Joined: Sun Jul 05, 2015 7:14 am

Re: wxFileConfig example?

Postby Anthony11 » Fri Jul 10, 2015 1:01 pm

thanks a bunch

Anthony11
Knows some wx things
Knows some wx things
Posts: 30
Joined: Sun Jul 05, 2015 7:14 am

Re: wxFileConfig example?

Postby Anthony11 » Fri Jul 10, 2015 1:09 pm

doublemax wrote:https://forums.wxwidgets.org/viewtopic.php?p=154875#p154875


Code: Select all

wxFileConfig * config = new wxFileConfig( "", "", filename);
config->Read( wxT("/initScript"), &initializationFile);
config->Read( wxT("/scriptEditor"), &scrEd);
config->Read( wxT("/imageEditor"), &imgEd);
delete config;


can you fix my read function as well?

User avatar
doublemax
Moderator
Moderator
Posts: 11290
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxFileConfig example?

Postby doublemax » Fri Jul 10, 2015 1:25 pm

Code: Select all

initializationFile = config->Read( wxT("/initScript") );
Use the source, Luke!

Anthony11
Knows some wx things
Knows some wx things
Posts: 30
Joined: Sun Jul 05, 2015 7:14 am

Re: wxFileConfig example?

Postby Anthony11 » Fri Jul 10, 2015 1:34 pm

doublemax wrote:

Code: Select all

initializationFile = config->Read( wxT("/initScript") );


sorry, my mistake, i've forgot to enter full path in 'filename'


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 8 guests