Reading a path value in an "ini" file
Xaviou <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
Hi.
As said in the title, I have to read some values in an ini file created by
another app.
Here is the corresponding part of the code (simplified):
*wxFileInputStream f_in(_T("Path to the ini file"));*
*wxFileConfig datas(f_in);*
*datas.SetPath(_T("/Settings"));*
*wxString sValue = datas.Read(_T("KeyName"));*
*......*
All works fine until the value of the corresponding key contains
backslashes (for example the fullpath to a last used file).
In this last case, the backslashes are treated as escape chars, and they
are removed (their following chars are also removed).
For example, reading the following:
*[Settings]KeyName=C:\Users\Xavier\Desktop\TestFile.txt*
will give:
*C:sersavieresktopestFile.txt*
As you can guess, I'm working on Windows.
I tried doing trhe same thing in pure Win32 code (using
*GetPrivateProfileString*), and it works correctly.
As the ini file is not very big, I can read it manually, line by line, but
I would prefer using the wxWidgets built-in classes if it was possible.
Is there something I am doing wrong ?
Regards
Xav'
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/cf0c0782-ea37-4cbf-b71a-4555c1f8e0d6n%40googlegroups.com.