本人现在想写一个扫雷程序,在BOOL CMineApp::InitInstance()函数中有以下代码:
SetRegistryKey("CSER_513_2");
m_uXMineNum = GetProfileInt(GAME_SETTING, CUSTOM_XNUM, PRIMARY_XNUM);
m_uYMineNum = GetProfileInt(GAME_SETTING, CUSTOM_YNUM, PRIMARY_YNUM);其中m_uXMineNum 和 m_uYMineNum 都是 UINT 类型;
请问:
SetRegistryKey("CSER_513_2");是什么意思,有什么作用?
还有就是GetProfileInt()是什么意思?
请各位高手相助.谢谢.
SetRegistryKey("CSER_513_2");
m_uXMineNum = GetProfileInt(GAME_SETTING, CUSTOM_XNUM, PRIMARY_XNUM);
m_uYMineNum = GetProfileInt(GAME_SETTING, CUSTOM_YNUM, PRIMARY_YNUM);其中m_uXMineNum 和 m_uYMineNum 都是 UINT 类型;
请问:
SetRegistryKey("CSER_513_2");是什么意思,有什么作用?
还有就是GetProfileInt()是什么意思?
请各位高手相助.谢谢.
UINT GetProfileInt(
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
INT nDefault
);Parameters
lpAppName
[in] Pointer to a null-terminated string that specifies the name of the section containing the key name.
lpKeyName
[in] Pointer to the null-terminated string specifying the name of the key whose value is to be retrieved. This value is in the form of a string; the GetProfileInt function converts the string into an integer and returns the integer.
nDefault
[in] Default value to return if the key name cannot be found in the initialization file.
Causes application settings to be stored in the registry instead of INI files.void SetRegistryKey(
LPCTSTR lpszRegistryKey
);
void SetRegistryKey(
UINT nIDRegistryKey
);
Parameters
lpszRegistryKey
Pointer to a string containing the name of the key.
nIDRegistryKey
ID/index of a key in the registry
小弟的英文真的很烂
尤其是SetRegistryKey这个函数有什么用处
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
INT nDefault
);
lpAppName--->包含键名的“文件夹”,字符串不能为空
lpKeyName--->键名,字符串不能为空
nDefault---》如果没有该键则返回该值,否则返回该键值
看看MSDN 还有一个对应的是WriteProfileInt
加油!