more desciption:
call more than once, return result is correct, but the first return string var's content will changed to the next call return value.
e.g.:
string sRet1="";
GetPrivateProfileStringA(......, sRet1, 255, sFileName);
Print("step1, sRet1=", sRet1);
string sRet2="";
GetPrivateProfileStringA(......, sRet2, 255, sFileName);
Print("step2, sRet1=", sRet1);
string sRet3="";
GetPrivateProfileStringA(......, sRet3, 255, sFileName);
Print("step3, sRet1=", sRet1);
after step1, the value of sRet1 is correct, but when step2 or step3 finished, the value of sRet1 had changed to sRet2 or sRet3!
I was confused now...
(and please notice that, if without init the out string parm using "" before calling the function, it will made the program crash...)
another problem: when I read 3 string key: sKey1, sKey2, sKey3, one by one,
if sKey3 not exists, then it will return the result of sKey2, not the default string I specify for skey3!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
int GetPrivateProfileStringA(string lpSection, string lpKey, string lpDefault, string lpReturnString, int dwSize, string lpFileName);
#import
The param "lpReturnString" is output type, it is so strange that,
when I call this function more than once, then I will get a result same as last time?