SetRegistryKey
来源:互联网 发布:流量劫持 sql注入 编辑:程序博客网 时间:2024/05/17 04:18
原型:
void SetRegistryKey( LPCTSTR lpszRegistryKey );
Void SetRegistryKey( UINT nIDRegistryKey );
参数lpszRegistryKey:字符串指针,包含了键的名字。
nIDRegistryKey:注册表中键的ID/索引。
功能:SetRegistryKey 这个函数功能是设置MFC程序的注册表访问键,并把读写 ini 文件的成员函数映射到读写注册表。只要调用一下 SetRegistryKey 并指定注册表键值,那么下面6个成员函数,就被映射到进行注册表读取了。
1、WriteProfileBinary
Writes binary data to an entry in the application's .INI file.
2、WriteProfileInt
Writes an integer to an entry in the application's .INI file.
3、WriteProfileString
Writes a string to an entry in the application's .INI file.
4、GetProfileBinary
Retrieves binary data from an entry in the application's .INI file.
5、GetProfileInt
Retrieves an integer from an entry in the application's .INI file.
6、GetProfileString
Retrieves a string from an entry in the application's .INI file.
例如:使用CWinApp类的WriteProfileString 、GetProfileString等函数:
1、如果不调用SetRegistryKey(),CWinApp 会把信息保存系统目录的的Test.ini文件中(C:\Windows\Test.ini)
2、如果调用SetRegistryKey(<company name>),CWinApp 会把信息保存系统目录的的注册表中
HKEY_CURRENT_USER\Software\<company name>\Test\<section name>\<value name>.
注:SetRegistryKey()是CWinApp的保护成员,只能被CWinApp的成员函数调用。而WriteProfileString 、GetProfileString等函数则是公共成员,可以随便调用,一般调用形式如:
theApp->WriteProfileString(); //在Test.cpp中。
AfxGetApp()->WriteProfileString(); 在其它源文件中
- SetRegistryKey
- SetRegistryKey
- SetRegistryKey
- SetRegistryKey函数
- SetRegistryKey的作用
- SetRegistryKey的作用(转载)
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- 过SetRegistrykey的作用
- SetRegistryKey的作用 [转]
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- SetRegistryKey的作用
- hdu 1561 The more, The Better(树形DP)
- 欢迎使用CSDN-markdown编辑器
- nodejs 中的 NODE_PATH
- java初级
- STM32 NVIC 抢占优先级和响应优先级
- SetRegistryKey
- Android layout_weight layout_width ,Listview单行特定textview省略
- cmd
- Android学习之路:控件总结
- Ubuntu下安装mysql
- ListView 实现全选功能
- python 图像识别
- 广告牌
- HBase-1. 搭建过程和集群安装注意事项