[转]Convert Win32 Console Application to MFC
2012-04-07 13:21
501 查看
原地址:http://www.codeproject.com/Tips/297862/Convert-Win32-Console-Application-to-MFC Assuming you have Console based application created with MFC support (i.e., you have not chosen MFC support while using New Project Wizard).
In this Tip/Trick, I am not going into detailed steps of how to create a new project and all. I assume you know all these and face a real life problem of adding MFC support to existing applications.
Follow these simple steps and your application will have MFC support.
Here I am using project name as MyApp and IDE is Visual Studio 2008. Open your project. In Project Menus --> Select MyApp Properties(MyApp -> name of my project) In Configuration Properties -> General -> Use of MFC, select Use MFC in a Shared DLL option. Add the following line in your stdafx.h file.
Now your application has MFC support, now you can use any MFC Class, Function or Structure.
Happy programming!
In this Tip/Trick, I am not going into detailed steps of how to create a new project and all. I assume you know all these and face a real life problem of adding MFC support to existing applications.
Follow these simple steps and your application will have MFC support.
Here I am using project name as MyApp and IDE is Visual Studio 2008. Open your project. In Project Menus --> Select MyApp Properties(MyApp -> name of my project) In Configuration Properties -> General -> Use of MFC, select Use MFC in a Shared DLL option. Add the following line in your stdafx.h file.
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit #ifndef VC_EXTRALEAN #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif #include <afx.h> #include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions #ifndef _AFX_NO_OLE_SUPPORT #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #endif #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT #include <iostream>
Now your application has MFC support, now you can use any MFC Class, Function or Structure.
Happy programming!
相关文章推荐
- 如何在win32控制台加入MFC对话框(Adding Windows To Your Console Application)
- Add Console Application Program to the MFC Program
- How to support MFC features in Win32 application?
- Convert console application to dll on Visual Studio
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- Unity3d 打包时报错 CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
- How to write a console application running in background (hidden window)?
- win32 console 与MFC设置问题
- Win32 Console Application、Win32 Application、MFC三者之间的联系和区别
- Win32和mfc下弹出console窗口的方法
- Win32Console工程加入MFC
- [转载]Step By Step - Using Silverlight to Access a WCF Service Hosted In a Console Application
- The call to LoadLibrary(YourExtensionName) failed, Win32 error 0n14001, “This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.”
- 从Win32 Application开始学MFC可以事半功倍
- 在 Win32 Application 和 Win32 Console Application 中使用 MFC
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- Interview Q&A - Write a C# console application to implement a string replacement function
- 在 Win32 Application 和 Win32 Console Application 中使用 MFC
- How to load "CodedUItestmethod" in another "consoleapplication".
- win32 console 兼容mfc标准stdafx.h文件