How to support MFC features in Win32 application?

摘要:
大多数时候,我们会为MFCandWin32应用程序编写一些通用代码,例如转换器操作(char、string、CString、int…conversion)。因此代码应该支持MFCandwin32功能。在本文中,我将为您提供一个示例

    Most of time, we will write some common code for MFC and Win32 applications, such as convert operations(char, string, CString, int... convertion). So the code should support MFC and Win32 features. In this article, I will give you an example about how to use MFC features in Win32 application.

    First, we have to create an common header file, named StdW32.h, which contains the MFC header files.

    Then, we have to include this header filel in all the *.h or *.cpp files.

    Now I attach the StdW32.h file code as below:

 1 // StdW32.h file for supporting MFC features in Win32 Application.
 2 // You can add some common header files here.
 3 // Make sure include this file in *.h or *.cpp files.
 4 
 5 #ifndef STDW32_H_
 6 #define STDW32_H_
 7 
 8 // Define windows version
 9 #ifndef WINVER                // Specifies that the minimum required platform is Windows Vista.  
10 #define WINVER 0x0500        // Win2k  
11 #endif   
12 
13 #ifndef _WIN32_WINNT        // Specifies that the minimum required platform is Windows Vista.  
14 #define _WIN32_WINNT 0x0500 // Win2k  
15 #endif
16 
17 // Support MFC features in Win32 application.
18 // Setting: Project Properties->Configuration Properties->General->Use of MFC->Use MFC in a Shared DLL.
19 #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
20 #include <afxwin.h>         // MFC core and standard components
21 #include <afxext.h>         // MFC extensions
22 #include <afxdisp.h>        // MFC Automation classes
23 #include <afxdtctl.h>        // MFC support for Internet Explorer 4 Common Controls
24 #ifndef _AFX_NO_AFXCMN_SUPPORT
25 #include <afxcmn.h>            // MFC support for Windows Common Controls
26 #endif // _AFX_NO_AFXCMN_SUPPORT
27 
28 
29 // Add common files here...
30 #include <iostream>
31 #include <string>
32 #include <vector>
33 
34 using namespace std;
35 
36 #endif // STDW32_H_

免责声明:文章转载自《How to support MFC features in Win32 application?》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Unicode和ANSI之间转换 NotePad++轻松实现SQL学习日志下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

给一名准90后程序员的指导——学好IT?无用论?

本文章转自http://blog.csdn.net/luozhuang/article/details/6423932 。 我觉得看过后对我很有启发,于是就转过来了~~ 收到一名程序员的邮件,我觉得可能有一定的代表性,特将此邮件与我的回邮发布,希望能对有类似境遇的朋友们有点点启发和鼓励的作用: ====================== 我是89年的,男...

京东商城副总裁李曦:大数据和电子商务_行业信息化_IT商业新闻网

京东商城副总裁李曦:大数据和电子商务_行业信息化_IT商业新闻网 京东商城副总裁李曦:大数据和电子商务 2012-07-24 17:18:03 IT商业新闻网 【大】【中】【小】 评论:[0] 条 京东商城研发系统副总裁李曦出席了本次会议并现场发言。李曦认为:“大数据商机无限,云计算是为大数据提供技术支撑,京东在建的电商云,将与业界电商一起分享运...

走过的laraveladmin 的坑

一、http://laravel-admin.org/docs/#/zh/ 大家可以根据这个安装1.5 版本的laravel后台管理, 他很方便哦,有很多方法他都自己自己封装了。 二、大家如果想好好做好一个项目的话一定要将它仔仔细细全部看完。。真的很有帮助。。 三、说一下我最近走过的坑 大家可以用php atrisan 这个建表,包括做数...

【leetcode】Add Two Numbers

Question: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two...

zc.lockfile 1.0.0

zc.lockfile 1.0.0 : Python Package Index zc.lockfile 1.0.0 Basic inter-process locks Downloads ↓ The zc.lockfile package provides a basic portable implementation ofinterprocess lo...

(2006, 'MySQL server has gone away') 错误解决 dba007的空间 51CTO技术博客

(2006, 'MySQL server has gone away') 错误解决 - dba007的空间 - 51CTO技术博客 (2006, 'MySQL server has gone away') 错误解决 2012-02-24 10:30:14 标签:OperationalError (2006 数据库 'MySQL server...