SetRegistryKey的作用
来源:互联网 发布:网络歌手招聘信息 编辑:程序博客网 时间:2024/05/21 08:39
在利用mfc框架的时候,在App应用类的InitInstance()函数中,初始化时总有一个 SetRegistryKey("字符串XXX")。如果你使用注册表保存相关参数,则它为你提供了很便利的方法,当然如果不使用系统注册表,这句可以注释掉。
SetRegistryKey 这个函数功能是设置MFC程序的注册表访问键,并把读写 ini 文件的成员函数映射到读写注册表。只要调用一下 SetRegistryKey 并指定注册表键值,那么下面6个成员函数,就被映射到进行注册表读取了~
WriteProfileBinary
Writes binary data to an entry in the application's .INI file.
WriteProfileInt
Writes an integer to an entry in the application's .INI file.
WriteProfileString
Writes a string to an entry in the application's .INI file.
GetProfileBinary
Retrieves binary data from an entry in the application's .INI file.
GetProfileInt
Retrieves an integer from an entry in the application's .INI file.
GetProfileString
Retrieves a string from an entry in the application's .INI file.
废话少说,举例如下:
BOOL COLContactFinal2005App::InitInstance()
{
SetRegistryKey(_T("COLContact "));
WriteProfileString(_T("OLTest"),_T("Test1"),_T("abc"));
}
执行上述代码将在注册表生成如下键值:
[HKEY_CURRENT_USER\Software\COLContact \OLContactFinal2005\OLTest]"Test1"="abc"
http://apps.hi.baidu.com/share/detail/34874018
- SetRegistryKey的作用
- SetRegistryKey的作用(转载)
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- 过SetRegistrykey的作用
- SetRegistryKey的作用 [转]
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用(转载)
- SetRegistryKey
- SetRegistryKey
- SetRegistryKey
- 为多个vlan配置DHCP实例
- 线程顺序执行(phtread)
- ActivityManager: Warning: Activity not started, its current task has been brought to the front
- 路由器和交换机常见故障信息收集命令总结
- ARP缓存中毒
- SetRegistryKey的作用
- Catalyst交换机配置TACACS+RADIUS,Kerberos
- wchar_t*转成float
- 准备静静心,先从UI开始。
- shell脚本中的各种参数
- 初探oracle
- 导致交换机接口出现err-disable的几个常见原因
- 【Android进阶】多抽屉效果 (类似最早QQ使用的效果)
- javascript基本语法