如何为现有的 Win32 C++ 项目添加 MFC 支持? [英] How to add MFC support to existing Win32 C++ Project?
问题描述
我正在创建一个 C++ 应用程序,它使用 Qt 来创建 GUI.但是,我需要使用依赖于 MFC(用于 CString 等)的第三方库.无论如何,是否可以将 MFC 添加到我的应用程序中以允许我使用这个库,或者我需要自己重写它吗?
I am creating a C++ application which uses Qt to create the GUI. However, I need to use a third party library which relies on MFC (for CString's, etc). Is there anyway to add MFC to my application to allow me to use this library or do I need to rewrite it myself?
我看到了这个问题,但它没有告诉我如何添加MFC手动到项目中.
I saw this question, but it doesn't tell me how to add MFC manually to the project.
推荐答案
如果库应用接受/返回/使用 CStrings,它将需要与 MFC 库链接,或者已经静态链接 MFC 库.
If the library app takes/returns/uses CStrings it will need linking with the MFC libs, or will have the MFC libs already statically linked.
如果您使用的是 Visual Studio,您可以根据需要勾选在静态/共享库中使用 MFc",只要您保留当前的程序入口点,它就不会影响您的应用程序 GUI.
If you are using Visual studio you can just check "use MFc in static/shared lib" as appropriate, it doesn;t affect your application GUI as long as you keep your current program entry point.
这篇关于如何为现有的 Win32 C++ 项目添加 MFC 支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!