如何在没有 C++ 可再发行支持的 Windows XP 中运行 MFC 应用程序 [英] How to run MFC application in windows XP without C++ redistributable support
问题描述
我的开发环境是
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).
问题:
- 我应该在 Visual Studio 中选择哪种项目?
- 我应该指定哪些项目设置?
推荐答案
这些是您在 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.
- 您必须选择项目类型
Win32->Win32 控制台应用程序
或Win32->Win32 项目
作为您的控制台或 GUI 要求. - 您必须在解决方案资源管理器中的
右键单击项目中选择
No Common Language Runtime support
->属性 ->一般 ->公共语言运行时支持 您的应用程序需要运行时程序集才能在目标计算机上运行.有两种方法可以在目标计算机中部署运行时 DLL
- You have to select project type
Win32-> Win32 Console Application
orWin32-> Win32 Project
as your console or GUI requirements. - You must select
No Common Language Runtime support
inright click project in solution explorer -> Properties -> General -> Common Language Runtime support
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屋!