【框架-MFC】MFC操作注册表
2013-05-11 00:23
197 查看
/************************************************************************/ /* MFC操作注册表 */ /************************************************************************/ class CWinAppX : public CWinAppEx { public: CWinAppX(); }; // 唯一的一个 CWinAppX 对象 CWinAppX theApp; std::list<CString> pFilePath; std::list<CString>::iterator ite; /************************************************************************/ /* 将字符串写入注册表 */ /************************************************************************/ void WriteRegedit()//CMainFram析构时 { CString strTmp; if(pFilePath.size()>8) pFilePath.resize(8);//重新设置文件路径个数 theApp.WriteProfileInt(L"ZhuiJinDaKaiWenJian",L"Counts",pFilePath.size()); ite= pFilePath.begin(); int i=0; while(ite!= pFilePath.end()) { strTmp.Format(L"%d",i+1); theApp.WriteProfileStringW(L"ZhuiJinDaKaiWenJian",strTmp,*ite); ite++; i++; } } /************************************************************************/ /* 将字符串从注册表读取出来 */ /************************************************************************/ void ReadRegedit()//CMainFram构造时 { CString strTmp; int counts= theApp.GetProfileIntW(L"ZhuiJinDaKaiWenJian",L"Counts",0); for(int i=0;i<counts;i++) { strTmp.Format(L"%d",i+1); CString str= theApp.GetProfileStringW(L"ZhuiJinDaKaiWenJian",strTmp,L""); if(str.IsEmpty()) continue; m_vLately.push_back(str); } }
相关文章推荐
- 【框架-MFC】字符串CString:操作
- MFC 注册表操作
- MFC注册表操作
- MFC注册表操作详解
- MFC注册表操作
- 关于开机启动运行的注册表操作(MFC)
- MFC 框架、文档、视图操作常用函数用法简析
- 九:[VC++]MFC操作注册表
- MFC的注册表操作—CRegKey类的使用
- MFC操作--数据输出、注册表、文件统计和获取上级目录
- MFC操作注册表
- 编程实现mscomm32写入注册表,解决写入值乱码问题,mfc中操作注册表操作。
- MFC注册表操作
- MFC对注册表的操作
- MFC 注册表操作
- C/C++/VC++/mfc对注册表的操作
- MFC操作注册表
- MFC操作注册表常用函数
- VS2013学习笔记之MFC框架CFile类文件操作
- MFC操作注册表