win7下MFC中如何序列化一个类?

发布于 2025-01-05 10:29:40 字数 211 浏览 5 评论 0原文

如何在win7的MFC中序列化一个类? 我的电脑是win7操作系统,安装的是vs2008。如果代码(包括序列化类并创建备份文件,将代码编程为执行文件并在我的计算机中运行)没问题,则可以打开序列化文件并加载数据。但如果在其他没有安装vs2008的win7电脑上,执行文件无法打开序列化文件并加载数据不成功,但在xp系统中运行成功。

我想让我的程序可以运行win7和xp,怎么做?非常感谢大家。

How to serialize a class in MFC for win7 ?
My computer is win7 operation system, and install vs2008. if the code, which include serialize a class and create a backup file, program the code as a execution File and run it in my computer is OK, it can open the serialized file and load data. but if the other win7 computer which not install vs2008, the execution File can not open the serialized file and load data is not success, but run in xp system is success.

I want to make my program can run win7 and xp,how to do it? thanks very much for everyone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

很酷不放纵 2025-01-12 10:29:40

如果您将文件放在“non-appdata”文件夹中,则可能会遇到 UAC 问题。您可以在此处检查可能的解决方案

If you are placing your file in "non-appdata" folder, perhaps you are having problems with UAC. You can check for a possible solution here

瞄了个咪的 2025-01-12 10:29:40

您是否尝试使用程序的 DEBUG 版本?

当您在 Visual Studio 下创建 MFC 程序时,它会创建一个 32 位的项目并使用 MFC 的 DEBUG 版本和运行时库。当您准备好分发程序时,请确保构建使用非 DEBUG 版本的 MFC 和运行时库的 RELEASE 版本。 VS2008 运行时库很可能已经位于您的目标 Windows 7 计算机上。如果没有,用户将必须从 Microsoft 下载并安装 Visual C++ 2008 运行时文件。

Are you trying to use the DEBUG version of your program?

When you create a MFC program under Visual Studio, it creates a project that is 32-bit and uses the DEBUG version of MFC and the Runtime library. When you get ready to distribute your program, make sure you build the RELEASE version which uses the non-DEBUG versions of MFC and the runtime library. In all likelihood, the VS2008 runtime libraries will already be on your target Windows 7 computer. If not, the user will have to download and install the Visual C++ 2008 runtime files from Microsoft.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文