在WIN32项目中使用MFC类 [英] using MFC classes in WIN32 Project

查看:164
本文介绍了在WIN32项目中使用MFC类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好可以为WIN32应用程序添加MFC支持(不是控制台应用程序)



谢谢

Hi is it possible to add MFC support to a WIN32 app (not a console app)

Thanks

推荐答案

设置项目 - >设置 - >在静态库中使用MFC



从stdafx.h中删除#includeWindows.h



将#includeafxwin.h添加到主项目文件
Set project->Settings->"Use MFC in a Static Library"

remove #include "Windows.h" from stdafx.h

add #include "afxwin.h" to main project file


这个问题没什么意义。 MFC只是图书馆。 MFC应用程序项目可以从适当的模板启动的事实没有任何意义;提供此模板只是为了方便起见。您随时可以随时开始使用所需的库。



但是,这里有一个简单实用的建议:从这个模板创建一个全新的MFC应用程序。查看项目选项以查看库的引用方式。由于这是C ++,因此需要引用一些头文件和一些库文件。并将其全部添加到您正在开发的现有项目中。有关使用MFC类及其与原始Windows API的关系的详细信息,请参阅MFC文档。



-SA
The question makes little sense. MFC is nothing but the library. The fact that MFC application project can be started from appropriate template means nothing; this template is provided just for convenience. You can always start using the libraries you want at any time later.

However, here is a simple practical advice: create a brand new MFC application from this template. Look at the project options to see how the library is referenced. As this is C++, this is a matter of referencing some header files and some library files. And add it all to your existing project you are developing. For detail of using MFC classes and how they are related to raw Windows API, address the MFC documentation.

—SA


这篇关于在WIN32项目中使用MFC类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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