从MFC Feature Pack将注册表访问转换为数据库调用 [英] Converting registry access to db calls from MFC Feature Pack

查看:89
本文介绍了从MFC Feature Pack将注册表访问转换为数据库调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可能会开始转换旧的VS2003 MFC项目,以使用MFC Feature Pack和VS2008提供的精美新功能.除了一件事以外,几个新的UI控件将非常不错-它们会自动将其信息保存到注册表中.我的注册表没有问题,但是对于用户用尽程序的多个环境而言,将用户数据保存到数据库要容易得多.

We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multiple environments the users use out program from, it's much easier to save user data to the database.

因此,我希望有一个主要的访问注册表"功能可以重载以指向数据库.但是简短的调查并没有发现任何问题.其他人在做类似事情上有成功吗?

So, I'm hoping that there is one main "access the registry" function that could be overloaded to point the database. But brief investigation hasn't turned up anything. Has anyone else had any success doing something similar?

推荐答案

根据

It seems like it should be possible to do what you're suggesting, according to the information on this page in MSDN. I haven't tried this myself, so I don't know how difficult it will be in practice.

根据文档,您应该创建一个继承 CSettingsStore 读取和写入设置,然后调用 CSettingsStoreSP::SetRuntimeClass ,以便框架使用您的类而不是默认类.

According to the documentation, you should create a class that inherits CSettingsStore to read and write the settings, and call CSettingsStoreSP::SetRuntimeClass so that the framework uses your class instead of the default.

这篇关于从MFC Feature Pack将注册表访问转换为数据库调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆