读书人

GetPrivateProfileInt函数返回值有关问

发布时间: 2012-03-02 14:40:28 作者: rapoo

GetPrivateProfileInt函数返回值问题!
请问GetPrivateProfileInt函数返回值能用WORD类型接收吗?会有什么不良后果吗?

[解决办法]
UINT GetPrivateProfileInt(
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
INT nDefault,
LPCTSTR lpFileName
);

[解决办法]
UINT

为啥用 WORD?
[解决办法]
WORD 16-bit unsigned integer.
This type is declared in WinDef.h as follows:
typedef unsigned short WORD;


UINT Unsigned INT.
This type is declared in WinDef.h as follows:
typedef unsigned int UINT;
[解决办法]
所以,
用 WORD 可能会丢失高位的信息。

读书人网 >C++

热点推荐