Closed jyhi closed 9 years ago
if (_tcsstr (lineBuf, "timeout") != NULL) if (_tcsstr (lineBuf, "default") != NULL)
These two lines does not compile when UNICODE
and _UNICODE
is set (which is default for latest Visual Studio).
Wrap your string literals with _T()
.
Recently I am aware that this method can ONLY recognize lowercase letters. That means, when uppercase letters exist, this method can be invalid.
Convert lineBuf
to lowercase before comparing.
Since you are reading and writing a INI
file. Why aren't you using Windows API to parse such a file?
@m13253
if (_tcsstr (lineBuf, "timeout") != NULL) if (_tcsstr (lineBuf, "default") != NULL)
These two lines does not compile when
UNICODE
and_UNICODE
is set (which is default for latest Visual Studio). Wrap your string literals with_T()
.
- [X] Will fix soon. (Fixed in 6345aee)
Convert lineBuf to lowercase before comparing.
Good Idea. Will fix soon.
Since you are reading and writing a INI file. Why aren't you using Windows API to parse such a file?
You mean GetPrivateProfileString
and WritePrivateProfileString
? There says, "calls to profile functions may be mapped to the registry instead of to the initialization files".
You mean GetPrivateProfileString and WritePrivateProfileString? There says, "calls to profile functions may be mapped to the registry instead of to the initialization files".
Okay... I was wrong.
I googled and found that Qt contains a INI parser. There are also some lightweight INI parser library in C such as inih
:
https://stackoverflow.com/questions/12633/what-is-the-easiest-way-to-parse-an-ini-file-in-c
But since this is a fairly simple INI. String searching and replacing should work.
In procedure deploy_edit_ntldr, we have implemented a BOOT.INI modification method.
Recently I am aware that this method can ONLY recognize lowercase letters. That means, when uppercase letters exist, this method can be invalid.
Need a better solution. Maybe we should use Regular Expression? Or other better solution?