win32程序中简单应用mfc

简介: <div id="cnblogs_post_body"> <p>今日写程序在win32中用CRect发现报错,突然想起来。要引入mfc库。想重新建立一个工程添加对mfc的支持。发现选项不能选。查资料后发现。</p> <p>在win32程序中简单应用mfc库,只需要简单的引入<afx.h>就好了。注意这个时候如果出来</p> <p>#ifdef _DLL<br> #ifn

今日写程序在win32中用CRect发现报错,突然想起来。要引入mfc库。想重新建立一个工程添加对mfc的支持。发现选项不能选。查资料后发现。

在win32程序中简单应用mfc库,只需要简单的引入<afx.h>就好了。注意这个时候如果出来

#ifdef _DLL
#ifndef _AFXDLL
#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
#endif
#endif

这个错误。只需要把use of mfc改为Use MFC in a Shared DLL就可以了。

当然<windows.h>头文件在mfc中已经包含所以去掉。

相关文章
|
3月前
|
C++
MFC创建带窗口的DLL
MFC创建带窗口的DLL
16 0
|
3月前
MFC编写DLL窗口功能代码
MFC编写DLL窗口功能代码
8 0
|
12月前
|
Windows
win32&mfc————win32消息机制(二)
win32&mfc————win32消息机制(二)
145 0
|
12月前
|
Windows
win32&mfc————win32消息机制(一)
win32&mfc————win32消息机制(一)
120 0
|
12月前
|
存储 Linux C++
win32&mfc————win32菜单栏&库(二)
win32&mfc————win32菜单栏&库(二)
84 0
|
12月前
|
编译器 C++
win32&mfc————win32菜单栏&库(一)
win32&mfc————win32菜单栏&库(一)
92 0
|
开发工具 C++ API
win32中使用MFC类库
在Project->Setting->General 中选Use MFC in a Shared DLL或者 Use MFC in static Library并把project->Setting->C/C++ 中的Use runing-time library 由Single-Threaded改为...
1278 0