如何在没有 C++ 可再发行支持的 Windows XP 中运行 MFC 应用程序 [英] How to run MFC application in windows XP without C++ redistributable support

查看:18
本文介绍了如何在没有 C++ 可再发行支持的 Windows XP 中运行 MFC 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的开发环境是

  1. C++

Visual Studio 2008

Visual Studio 2008

Windows 7

我将开始一个项目(MFC 应用程序),最终结果(exe)应该可以在 windows xp、vista、windows 7 或 windows 8 上运行,而无需安装任何额外的包(如 Visual C++ Redistributable 包).

I'm going to start a project (MFC application) and final result (exe) should run on windows xp, vista ,windows 7 or windows 8 without installing any extra packages (like Visual C++ Redistributable package).

问题:

  1. 我应该在 Visual Studio 中选择哪种项目?
  2. 我应该指定哪些项目设置?

推荐答案

这些是您在 Visual Studio 中启动需要在目标计算机上运行而不安装任何其他重新分发组件的项目时必须考虑的基本事项.

These are the basic things you have to consider when you start a project in Visual studio that need to run in target computer without installing any other redistribute components.

  1. 您必须选择项目类型 Win32->Win32 控制台应用程序Win32->Win32 项目作为您的控制台或 GUI 要求.
  2. 您必须在解决方案资源管理器中的右键单击项目中选择No Common Language Runtime support ->属性 ->一般 ->公共语言运行时支持
  3. 您的应用程序需要运行时程序集才能在目标计算机上运行.有两种方法可以在目标计算机中部署运行时 DLL

  1. You have to select project type Win32-> Win32 Console Application or Win32-> Win32 Project as your console or GUI requirements.
  2. You must select No Common Language Runtime support in right click project in solution explorer -> Properties -> General -> Common Language Runtime support
  3. Your application need run-time assemblies to run in target computer. There is two methods to deploy run time DLLs in target computer

  • 程序集静态链接(在解决方案资源管理器中右键单击项目 -> 属性 -> 常规 -> MFC 的使用和 ATL 的使用).但是如果你的应用结合了多个DLL EXE和LIB,这个方法就比较麻烦.

  • Assemblies link statically ( right click project in solution explorer -> Properties -> General -> Use of MFC and Use of ATL). but if your application combine with multiple DLL EXE and LIBs, this method is quite troublesome.

在目标计算机中部署运行时 DLL 作为私有程序集(我个人推荐这种方法).更多详情此处

Deploy Runtime DLLs in target computer as private assemblies (I personally recommend this method). More details here

这篇关于如何在没有 C++ 可再发行支持的 Windows XP 中运行 MFC 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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