您的位置:首页 > 其它

关于读取INI文件的API问题

2017-01-19 10:56 246 查看
GetPrivateProfileString的返回值,我觉得设计的有问题,,
The return value is the number of characters copied to the buffer, not including the terminating null character.

If neither lpAppName nor lpKeyName is NULL and the supplied destination buffer is too small to hold the requested string, the string is truncated and followed by a null character, and the return value is equal to nSize minus one.

If either lpAppName or lpKeyName is NULL and the supplied destination buffer is too small to hold all the strings, the last string is truncated and followed by two null characters. In this case, the return value is equal to nSize minus two.

假设事先我也不知道INI文件里的一个KEY的值有多少字符,就给了一个50字符的BUG去读,返回值49! 这时我怎么判断有没有读完呢,,,

类似这样的问题还有_tstol,也是一样,无法判断啊,,,
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: